storm kafka集成

Spoutconfig is an extension of KafkaConfig that supports additional fields with ZooKeeper connection info and for controlling behavior specific to KafkaSpout. The Zkroot will be used as root to store your consumer's offset. The id should uniquely identify your spout.

        SpoutConfig spoutConfig=new SpoutConfig(BrokerHosts hosts, String topic, String zkRoot, String id));

hosts:指明zookeeper cluster的地址

topic:指明消费kafka topic 名称

zkroot参数:指明存储consumer offset的目录位置

id:用来唯一的标识spout

 

posted @ 2016-11-07 17:06  程序猿进化之路  阅读(117)  评论(0)    收藏  举报