title: KafkaSpout working example
body: <p>I recently got familiar with Apache Kafka and have a working example of a producer-consumer.</p>
  
  <p>My next step is to integrate Kafka with Spout and Bolt and i am having a hard time getting the examples available(they are mostly old) working locally.</p>
  
  <p>I got the following example working storm-book/examples-ch02-getting_started which is reading data from a local  text file. </p>
  
  <p>The same repo has an example for storm-book/examples-ch04-spouts <a href="https://github.com/storm-book/examples-ch04-spouts">kafka-spout</a>  but i am not able to get it to work.</p>
  
  <p>I tried the following example as well <a href="https://github.com/buildlackey/cep/tree/master/storm%2Bkafka">cep.kafka</a> but got the following error- </p>
  
  <pre><code>5034 [Thread-11-words] INFO  org.apache.curator.framework.imps.CuratorFrameworkImpl - Starting
  5047 [Thread-11-words] ERROR backtype.storm.util - Async loop died!
  java.lang.NoSuchMethodError: org.apache.zookeeper.ZooKeeper.&lt;init&gt;(Ljava/lang/String;ILorg/apache/zookeeper/Watcher;Z)V
          at org.apache.curator.utils.DefaultZookeeperFactory.newZooKeeper(DefaultZookeeperFactory.java:29) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.framework.imps.CuratorFrameworkImpl$2.newZooKeeper(CuratorFrameworkImpl.java:169) ~[curator-framework-2.4.0.jar:na]
          at org.apache.curator.HandleHolder$1.getZooKeeper(HandleHolder.java:94) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.HandleHolder.getZooKeeper(HandleHolder.java:55) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.ConnectionState.reset(ConnectionState.java:219) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.ConnectionState.start(ConnectionState.java:103) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.CuratorZookeeperClient.start(CuratorZookeeperClient.java:188) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.framework.imps.CuratorFrameworkImpl.start(CuratorFrameworkImpl.java:234) ~[curator-framework-2.4.0.jar:na]
          at storm.kafka.ZkState.&lt;init&gt;(ZkState.java:62) ~[storm-kafka-0.9.2-incubating.jar:0.9.2-incubating]
          at storm.kafka.KafkaSpout.open(KafkaSpout.java:85) ~[storm-kafka-0.9.2-incubating.jar:0.9.2-incubating]
          at backtype.storm.daemon.executor$fn__3371$fn__3386.invoke(executor.clj:522) ~[storm-core-0.9.4.jar:0.9.4]
          at backtype.storm.util$async_loop$fn__460.invoke(util.clj:461) ~[storm-core-0.9.4.jar:0.9.4]
          at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
          at java.lang.Thread.run(Thread.java:745) [na:1.8.0_05]
  5049 [Thread-11-words] ERROR backtype.storm.daemon.executor -
  java.lang.NoSuchMethodError: org.apache.zookeeper.ZooKeeper.&lt;init&gt;(Ljava/lang/String;ILorg/apache/zookeeper/Watcher;Z)V
          at org.apache.curator.utils.DefaultZookeeperFactory.newZooKeeper(DefaultZookeeperFactory.java:29) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.framework.imps.CuratorFrameworkImpl$2.newZooKeeper(CuratorFrameworkImpl.java:169) ~[curator-framework-2.4.0.jar:na]
          at org.apache.curator.HandleHolder$1.getZooKeeper(HandleHolder.java:94) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.HandleHolder.getZooKeeper(HandleHolder.java:55) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.ConnectionState.reset(ConnectionState.java:219) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.ConnectionState.start(ConnectionState.java:103) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.CuratorZookeeperClient.start(CuratorZookeeperClient.java:188) ~[curator-client-2.4.0.jar:na]
          at org.apache.curator.framework.imps.CuratorFrameworkImpl.start(CuratorFrameworkImpl.java:234) ~[curator-framework-2.4.0.jar:na]
          at storm.kafka.ZkState.&lt;init&gt;(ZkState.java:62) ~[storm-kafka-0.9.2-incubating.jar:0.9.2-incubating]
          at storm.kafka.KafkaSpout.open(KafkaSpout.java:85) ~[storm-kafka-0.9.2-incubating.jar:0.9.2-incubating]
          at backtype.storm.daemon.executor$fn__3371$fn__3386.invoke(executor.clj:522) ~[storm-core-0.9.4.jar:0.9.4]
          at backtype.storm.util$async_loop$fn__460.invoke(util.clj:461) ~[storm-core-0.9.4.jar:0.9.4]
          at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
          at java.lang.Thread.run(Thread.java:745) [na:1.8.0_05]
  5088 [Thread-11-words] ERROR backtype.storm.util - Halting process: ("Worker died")
  java.lang.RuntimeException: ("Worker died")
          at backtype.storm.util$exit_process_BANG_.doInvoke(util.clj:325) [storm-core-0.9.4.jar:0.9.4]
          at clojure.lang.RestFn.invoke(RestFn.java:423) [clojure-1.5.1.jar:na]
          at backtype.storm.daemon.worker$fn__4693$fn__4694.invoke(worker.clj:491) [storm-core-0.9.4.jar:0.9.4]
          at backtype.storm.daemon.executor$mk_executor_data$fn__3272$fn__3273.invoke(executor.clj:240) [storm-core-0.9.4.jar:0.9.4]
          at backtype.storm.util$async_loop$fn__460.invoke(util.clj:473) [storm-core-0.9.4.jar:0.9.4]
          at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na]
          at java.lang.Thread.run(Thread.java:745) [na:1.8.0_05]
  </code></pre>