Kafka, mail # user - kafka.common.FailedToSendMessageException: Failed to send messages after 3 tries. - 2013-06-25, 04:21
 Search Hadoop and all its subprojects:

Switch to Threaded View
Copy link to this message
kafka.common.FailedToSendMessageException: Failed to send messages after 3 tries.
Hi Team,

We are using  kafka-0.8.0-beta1-candidate1 release. (
While running producer with following configuration, we found an issue
FailedToSendMessageException: Failed to send messages after 3 tries",

We are using default broker configurations.

Code snippet:

private Producer<byte[], byte[]> producer = null;

  public KafkaProducer() {
    Properties props = new Properties();
    props.put("metadata.broker.list", "broker1:9092<>
,broker2:9092 <>,broker3:9092<>
,broker4:9092 <>,broker5:9092<>
    *props.put("producer.type", "sync");*
    ProducerConfig config = new ProducerConfig(props);
    producer = new Producer<byte[], byte[]>(config);

  public void publishTinCanMessage(String message, int event) throws
Exception {
    KeyedMessage<byte[], byte[]> data = new KeyedMessage<byte[],


Found issue:
*FailedToSendMessageException: Failed to send messages after 3 tries.*
        at kafka.producer.Producer.send(Producer.scala:74)
        at kafka.javaapi.producer.Producer.send(Producer.scala:32)
        at com.pearson.firehose.KafkaProducer.main(KafkaProducer.java:44)

But. with *props.put("producer.type", "async"); *the producer was working
fine and generating messages.

Could you please help us to understand is there any configuration missing
or is there any issue with "producer.type=sync"?
Thanks in advance.

Yogesh Sangikar

NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB