Hi Muthu,
Thanks for replying.PFB my replies:-
Is your ZK running on the same system as one of broker instance ?
Yes, ZK, broker,console-producer, console-consumer are running on the same box
- 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 brokerI don't think this should be a problem because my
console producer can send the messages to the console consumers. But, to be
double sure of it, I will verify this.
- Is your topic created and accessible via ‘sudo ./bin/kafka-topics.sh’
command remotely with –describe flag?
Yes,I can see my topic listed when I use the command - kafka-topics.sh
--describe kafkatopic --zookeeper crazybox:2181
- 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 ?
They are run locally so there are no remote connections involved.
Thanks,Bhargo
On Saturday, March 26, 2016 8:48 PM, Muthukumaran K
<[email protected]> wrote:
#yiv2134647246 #yiv2134647246 -- _filtered #yiv2134647246
{font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv2134647246
{font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;} _filtered #yiv2134647246
{font-family:Wingdings;panose-1:5 0 0 0 0 0 0 0 0 0;} _filtered #yiv2134647246
{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv2134647246
{font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}#yiv2134647246
#yiv2134647246 p.yiv2134647246MsoNormal, #yiv2134647246
li.yiv2134647246MsoNormal, #yiv2134647246 div.yiv2134647246MsoNormal
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv2134647246 a:link,
#yiv2134647246 span.yiv2134647246MsoHyperlink
{color:blue;text-decoration:underline;}#yiv2134647246 a:visited, #yiv2134647246
span.yiv2134647246MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}#yiv2134647246
p.yiv2134647246MsoListParagraph, #yiv2134647246
li.yiv2134647246MsoListParagraph, #yiv2134647246
div.yiv2134647246MsoListParagraph
{margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv2134647246
span.yiv2134647246EmailStyle17 {color:#1F497D;}#yiv2134647246
.yiv2134647246MsoChpDefault {font-size:10.0pt;} _filtered #yiv2134647246
{margin:1.0in 1.0in 1.0in 1.0in;}#yiv2134647246 div.yiv2134647246WordSection1
{}#yiv2134647246 _filtered #yiv2134647246 {} _filtered #yiv2134647246 {}
_filtered #yiv2134647246 {} _filtered #yiv2134647246 {font-family:Wingdings;}
_filtered #yiv2134647246 {font-family:Symbol;} _filtered #yiv2134647246 {}
_filtered #yiv2134647246 {font-family:Wingdings;} _filtered #yiv2134647246
{font-family:Symbol;} _filtered #yiv2134647246 {} _filtered #yiv2134647246
{font-family:Wingdings;}#yiv2134647246 ol {margin-bottom:0in;}#yiv2134647246 ul
{margin-bottom:0in;}#yiv2134647246 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:[email protected]]
Sent: Saturday, March 26, 2016 8:08 PM
To: [email protected]
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