I'm collecting currently my first expirience with kafka for a whole no project in our company.
We already had a first alpha version of our new system running with kafka version 7.2. But as the kafka version 0.8 will support replication, we thought about already testing this version (as we wanted to avoid setting up drbd on version 7.2).
ProducerConfig config = new ProducerConfig(props);
Producer<String, String> producer = new Producer<String, String>(config);
System.out.println(config.props().toString()); KeyedMessage<String, String> data = new KeyedMessage<String, String>( "m", "test1" ); producer.send(data); producer.close(); } }
Unfortunately the above code always throws me the following runtime exception:
Exception in thread "main" kafka.common.FailedToSendMessageException: Failed to send messages after 3 tries. at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:88) at kafka.producer.Producer.send(Producer.scala:74) at kafka.javaapi.producer.Producer.send(Producer.scala:32) at com.mach.mme.alpha.ngb.pgreader.kafkaWriterTest.main(kafkaWriterTest.java:24)
But as I have a consumer already connected to the topic, I can see the one sent message appearing four times.
in the kafka-logs I can only see the following: [2013-06-17 16:21:41,812] INFO Closing socket connection to /10.2.133.50. (kafka.network.Processor) [2013-06-17 16:21:41,978] INFO Closing socket connection to /10.2.133.50. (kafka.network.Processor) [2013-06-17 16:21:41,978] INFO Closing socket connection to /10.2.133.50. (kafka.network.Processor) [2013-06-17 16:21:42,083] INFO Closing socket connection to /10.2.133.50. (kafka.network.Processor) [2013-06-17 16:21:42,084] INFO Closing socket connection to /10.2.133.50. (kafka.network.Processor) [2013-06-17 16:21:42,189] INFO Closing socket connection to /10.2.133.50. (kafka.network.Processor)
This I could not find in the 7.2 version at all. Can you assist me on my problem and maybe give me a hint, what could be the problem on my setup?
Notes: - tried with a single instance cluster and with 3 kafka instances - also tried to change some properties in the producer, but could not identify yet, what the problem exactly is. - maybe interesting: producer and kafka-cluster running on same node.
If you need further information, I'll be happy to provide you with all the information you need.
Ok, then it seems as I do not have the latest API, as if I'm using "metadata.broker.list" I got the error " requirement failed: Missing required property 'broker.list' " Let me check if I can figure out on my side, what is going wrong.
Thanks for your hint. regards Markus 2013/6/18 Jun Rao <[EMAIL PROTECTED]>
Re: Kafka 0.8 producer: Failed to send messages after 3 tries
thanks for your hint, with the newest 0.8beta1 code it is now working. regards Markus 2013/6/18 Markus Roder <[EMAIL PROTECTED]>
NEW: Monitor These Apps!
Apache Lucene, Apache Solr and all other Apache Software Foundation projects and their respective logos are trademarks of the Apache Software Foundation.
Elasticsearch, Kibana, Logstash, and Beats are trademarks of Elasticsearch BV, registered in the U.S. and in other countries. This site and Sematext Group is in no way affiliated with Elasticsearch BV.
Service operated by Sematext