我想创建storm-kafka拓扑,但是spout从kafka可重复读取数据,我发现没有创建zkRoot。有谁知道原因?
String brokerZkStr = "192.168.2.125:2181";
String topic = "topic_kafka";
String zkRoot = "/stormffbkafka";
String id = "kafka-word";
TopologyBuilder builder = new TopologyBuilder();
BrokerHosts hosts = new ZkHosts(brokerZkStr);
SpoutConfig spoutConfig = new SpoutConfig(hosts, topic, zkRoot, id);
spoutConfig.scheme = new SchemeAsMultiScheme(new StringScheme());
spoutConfig.zkServers=new ArrayList<String>(Arrays.asList("192.168.2.125"));
spoutConfig.zkPort = 2181;
KafkaSpout kafkaSpout = new KafkaSpout(spoutConfig);
答案 0 :(得分:0)
尝试删除&#34; /&#34;来自zkroot
String zkRoot = "stormffbkafka";
感谢。