Hi Alper, can you share your producer config -- the Properties object? We need to learn more to help you understand the behavior you're observing.
Thanks, Alex On Fri, Aug 5, 2016 at 7:45 PM, Alper Akture <al...@goldenratstudios.com> wrote: > I'm using 0.10.0.0 and testing some failover scenarios. For dev, i have > single kafka node and a zookeeper instance. While sending events to a > topic, I shutdown the broker to see if my failover handling works. However, > I don't see any indication that the send failed, but I do see the > connection refused errors logged at debug. What is the standard way to > detect a message send failure, and handle it for offline processing later? > > Here's the debug output I see: > > 19:20:00.906 [kafka-producer-network-thread | producer-1] DEBUG > org.apache.kafka.clients.NetworkClient - Initialize connection to node -1 > for sending metadata request > 19:20:00.906 [kafka-producer-network-thread | producer-1] DEBUG > org.apache.kafka.clients.NetworkClient - Initiating connection to node -1 > at localhost:9092. > 19:20:00.907 [kafka-producer-network-thread | producer-1] DEBUG > org.apache.kafka.common.network.Selector - Connection with localhost/ > 127.0.0.1 disconnected > java.net.ConnectException: Connection refused > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.8.0_66] > at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) > ~[?:1.8.0_66] > at > org.apache.kafka.common.network.PlaintextTransportLayer.finishConnect( > PlaintextTransportLayer.java:51) > ~[kafka-clients-0.10.0.0.jar:?] > at > org.apache.kafka.common.network.KafkaChannel.finishConnect(KafkaChannel. > java:73) > ~[kafka-clients-0.10.0.0.jar:?] > at > org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector. > java:309) > [kafka-clients-0.10.0.0.jar:?] > at org.apache.kafka.common.network.Selector.poll(Selector.java:283) > [kafka-clients-0.10.0.0.jar:?] > at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:260) > [kafka-clients-0.10.0.0.jar:?] > at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:229) > [kafka-clients-0.10.0.0.jar:?] > at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:134) > [kafka-clients-0.10.0.0.jar:?] > at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66] > 19:20:00.907 [kafka-producer-network-thread | producer-1] DEBUG > org.apache.kafka.clients.NetworkClient - Node -1 disconnected. > 19:20:00.907 [kafka-producer-network-thread | producer-1] DEBUG > org.apache.kafka.clients.NetworkClient - Give up sending metadata request > since no node is available >