You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Joe San <co...@gmail.com> on 2016/02/14 17:06:47 UTC

Apache Kafka 0.8.2 Zookeeper Reconnect

Which is the setting that enables me to reconnect to a non existing broker?
I have a Kafka broker and Zookeeper running on my localhost. I have a
consumer that consumes messages from a topic. I then shutdown the broker
and Zookeeper and I can see in my application that it attempts to
re-connect:

20160214-16:58:10.983+0100
[tsdb-kafka-consumer-akka.actor.default-dispatcher-2-SendThread(
127.0.0.1:2181)] INFO  org.apache.zookeeper.ClientCnxn - Opening socket
connection to server 127.0.0.1/127.0.0.1:2181. Will not attempt to
authenticate using SASL (unknown error)
20160214-16:58:10.984+0100
[tsdb-kafka-consumer-akka.actor.default-dispatcher-2-SendThread(
127.0.0.1:2181)] WARN  org.apache.zookeeper.ClientCnxn - Session
0x152e01545e00020 for server null, unexpected error, closing socket
connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_60]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
~[na:1.8.0_60]
at
org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
~[zookeeper-3.4.6.jar:3.4.6-1569965]
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
~[zookeeper-3.4.6.jar:3.4.6-1569965]

I only have the following as my consumer properties:

props.put("zookeeper.connect", zookeeper)
props.put("group.id", groupId)
props.put("auto.commit.enabled", "false")
props.put("zookeeper.sync.time.ms", "200")

Any ideas as to how and where does the Zookeeper is automatically
re-connected??