Can you elaborate on this. "Is broker able to connect to ZK properly ? May be this can be checked via ZK CLI tools to check if the broker registrations happen properly as soon as you start Kafka broker" On Mar 26, 2016 8:18 AM, "Muthukumaran K" <muthukumara...@ericsson.com> wrote:
> Hi Bhargo, > > I ran into similar issues mainly due to firewall restrictions in my setup > with remote VM running broker and ZK. In my little experience, few things > to check concretely before running our own clients to see if the changes of > server.properties is properly done > > > - Is your ZK running on the same system as one of broker instance ? > > - Is broker able to connect to ZK properly ? May be this can be > checked via ZK CLI tools to check if the broker registrations happen > properly as soon as you start Kafka broker > > - Is your topic created and accessible via ‘sudo > ./bin/kafka-topics.sh’ command remotely with –describe flag? > > - Was console-producer and console-consumer run from a remote > machine to check if they really work with the remote broker config changes > you have done ? > > This can help troubleshooting where the issue lies. > > Regards > Muthu > > > From: amar dev [mailto:amar_9...@yahoo.com.INVALID] > Sent: Saturday, March 26, 2016 8:08 PM > To: users@kafka.apache.org > Subject: Error while publishing messages > > Hi Team!! > > I am working on a POC for my project, where I want to replace RabbitMQ > with Kafka > I am using the 0.9.0.1 version of kafka on my Ubuntu 15.10 version. > I have been able to setup the basic setup, where from the console producer > I can send messages and from the console consumer, I can consume them as > well. > But, when I try to create a java program to send the messages to the same > topic, I get an exception stacktrace in my IDE console and my console > consumer shows the same message 4 times. > > The exception that I get is the following:- > Exception in thread "main" kafka.common.FailedToSendMessageException: > Failed to send messages after 3 tries. > at > kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:91) > at kafka.producer.Producer.send(Producer.scala:77) > at kafka.javaapi.producer.Producer.send(Producer.scala:33) > at com.bhargo.main.MainClass.publishMessage(MainClass.java:47) > at com.bhargo.main.MainClass.main(MainClass.java:58) > > I am not sure what the issue is, I have made sure that server.properties > file that is used to startup my broker has the correct configurations:- > zookeeper.connect=crazybox:2181 > advertised.port=9092 > advertised.host.name=crazybox > host.name=crazybox > port=9092 > > On running the command hostname , I get the result as "crazybox" and > hostname -i, gives me 127.0.0.1 > I am attaching the code for your reference. > Please have a look once. > > Any help here is much appreciated. > > Thanks, > Bhargo >