title: Kafka's ZookeeperConsumerConnector.createMessageStreams never returns
body: <p>I'm trying to retrieve data from my Kafka 0.8.1 cluster. I have brought into existence an instance of <code>ZookeeperConsumerConnector</code> and then attempt to call <code>createMessageStreams</code> on it. However, no matter what I do, it seems <code>createMessageStreams</code> just hangs and never returns, even if it is the only thing I have done with Kafka.</p>
  
  <p>Reading mailing lists it seems this can sometimes happen for a few reasons, but as far as I can tell I haven't done any of those things.</p>
  
  <p>Further, I'll point out that I'm actually doing this in Clojure using clj-kafka, but I suspect clj-kafka is not the issue because I have the problem even if I run this code:</p>
  
  <pre><code>(.createMessageStreams
    (clj-kafka.consumer.zk/consumer {"zookeeper.connect" "127.0.0.1:2181"
                                     "group.id" "my.consumer"
                                     "auto.offset.reset" "smallest"
                                     "auto.commit.enable" "false"})
    {"mytopic" (int 1)})
  </code></pre>
  
  <p>And <a href="https://github.com/pingles/clj-kafka/blob/master/src/clj_kafka/consumer/zk.clj" rel="nofollow"><code>clj-kafka.consumer.zk/consumer</code></a> just uses <code>Consumer.createJavaConsumerConnector</code> to create a <code>ZookeeperConsumerConnector</code> without doing anything too fancy.</p>
  
  <p>Also, there are definitely messages in "mytopic" because from the command line I can run the following and get back everything I've already sent to the topic:</p>
  
  <pre><code>% kafka-console-consumer.sh --zookeeper 127.0.0.1:2181 --topic mytopic --from-beginning
  </code></pre>
  
  <p>So it's also not that the topic is empty.</p>
  
  <p>Feeling stumped at this point. Ideas?</p>
  
  <p><strong>ETA:</strong> By "hang" I guess what I really mean is that it seems to spin up a thread and then stay stuck in it never doing anything. If I run this code from the REPL I can get out of it by hitting control-c and then I get this error:</p>
  
  <pre><code>IllegalMonitorStateException   java.util.concurrent.locks.ReentrantLock$Sync.tryRelease (ReentrantLock.java:155)
  </code></pre>