卡夫卡喷口配置错误

时间:2017-07-26 09:42:54

标签: maven apache-kafka apache-storm

系统环境:

风暴0.9.2孵化

Apache Maven 3.0.5

Java版本:1.7.0_55,供应商:Oracle Corporation

操作系统名称:“linux”,版本:“3.13.0-24-generic”,arch:“i386”,系列:“unix”

这是我的代码:

  $("#turbingrid").kendoGrid({
                        //   debugger;

                        dataSource: dataSource,
                        scrollable: false,                          
                        columns: [
                                 { field: 'DeviceIP', title: 'DeviceIP', width: '100px', id: 'DeviceIP' },
                                 { field: 'Producer', title: 'Producer', width: '80px', editor: ProductNameDropDownEditor, },
                                 { field: 'Model', title: 'Model', width: '220px' },
                                 { field: 'DeviceType', title: 'DeviceType', width: '100px',editor: deviceTypesList  },
                                 { field: 'Description', title: 'Description', width: '220px' },
                                 { field: 'Username', title: 'Username', width: '120px' },
                                 { field: 'Password', title: 'Password', width: '100px' },
                                 { field: 'PublicIP', title: 'PublicIP', width: '120px' },
                                 { field: 'device_id', title: 'device_id', width: '120px',hidden:true },
                                 { command: ["edit"], title: " " }],
                        editable: "popup",
                        //edit:
                        //    function () {
                        //        document.getElementsByName("DeviceIP")[0].disabled = true;

                        //    },

                            edit: function(e) {
                                e.container.find("label[for='device_id']").parent().hide();
                                e.container.find("div[data-container-for='device_id']").hide();
                            }                                                                                  
                    });

我成功完成了风暴kafka集成,但我需要忽略zookeeper偏移 kafkaSpoutConfig.ignoreZKOffsets = true; 但是当我尝试使用maven构建时出现错误。

        Config conf = new Config();
        conf.setDebug(true);



        String zkConnString = "localhost:2181";
        String topic = "tap";
        BrokerHosts hosts = new ZkHosts(zkConnString);


        SpoutConfig kafkaSpoutConfig = new SpoutConfig (hosts, topic, "/" + topic,  UUID.randomUUID().toString());
        kafkaSpoutConfig.bufferSizeBytes = 1024 * 1024 * 4;
        kafkaSpoutConfig.fetchSizeBytes = 1024 * 1024 * 4;

        kafkaSpoutConfig.ignoreZKOffsets = true;

如何忽略zkoffests?请举例说明使用zkoffests ..

1 个答案:

答案 0 :(得分:0)

You are importing the wrong package for SpoutConfig.

Try using org.apache.storm.kafka.SpoutConfig (available in storm-core maven dependency) instead of storm.kafka.SpoutConfig (available in storm-kafka maven dependency).