Ok, I could make the example work.
The problem was that on the wiki page, there was no value for 
"zk.connectiontimeout.ms".I inserted a value for that property (value = 100000) 
and the example worked.
Also, I realized my mail client messed up the earlier message.
Here's the URL for the wiki page I was referring to - 
https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example

      From: Jayesh Thakrar <j_thak...@yahoo.com.INVALID>
 To: "users@kafka.apache.org" <users@kafka.apache.org> 
 Sent: Tuesday, January 6, 2015 11:09 AM
 Subject: Zookeeper Connection When Using High Level Sample Consumer Code from 
Wiki
   
When I try running the Java Consumer example at 
https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+ExampleI get 
the following zookeeper connection error.
I have verified zookeeper connectivity using a  variety fo means (using 
Zookeeper built-in client, sending 4-letter commands to the zk port, etc.) - so 
I know the zookeeper info is correct.
Here's the error I get. Any pointers will be greatly appreciated.
 Exception in thread "main" org.I0Itec.zkclient.exception.ZkTimeoutException: 
Unable to connect to zookeeper server within timeout: 400 at 
org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:880) at 
org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:98) at 
org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:84) at 
kafka.consumer.ZookeeperConsumerConnector.connectZk(ZookeeperConsumerConnector.scala:170)
 at 
kafka.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:126)
 at 
kafka.javaapi.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:66)
 at 
kafka.javaapi.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:69)
 at 
kafka.consumer.Consumer$.createJavaConsumerConnector(ConsumerConnector.scala:100)
 at 
kafka.consumer.Consumer.createJavaConsumerConnector(ConsumerConnector.scala) at 
kafka_sample.Consumer.<init>(Consumer.java:21) at 
kafka_sample.Consumer.main(Consumer.java:71)

  

Reply via email to