Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kafka Producer: Got error produce response with correlation NETWORK_EXCEPTION

We are running kafka in distributed mode across 2 servers. I'm sending messages to Kafka through Java sdk to a Queue which has Replication factor 2 and 1 partition.

We are running in async mode. I don't find anything abnormal in Kafka logs. Can anyone help in finding out what could be cause?

    Properties props = new Properties();
            props.put("bootstrap.servers", serverAdress);
            props.put("acks", "all");
            props.put("retries", "1");
            props.put("linger.ms",0);
            props.put("buffer.memory",10240000);
            props.put("max.request.size", 1024000);
            props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
            props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");

   Producer<String, Object> producer = new org.apache.kafka.clients.producer.KafkaProducer<>(props);

Exception trace:

-2017-08-15T02:36:29,148 [kafka-producer-network-thread | producer-1] WARN producer.internals.Sender - Got error produce response with correlation id 353736 on topic-partition BPA_BinLogQ-0, retrying (0 attempts left). Error: NETWORK_EXCEPTION

like image 584
Anil Kumar Avatar asked Aug 17 '17 14:08

Anil Kumar


1 Answers

You are getting a NETWORK_EXCEPTION so this should tell you that something is wrong with the network connection to the Kafka Broker you were producing toward. Either the broker shutdown or the TCP connection was shutdown for some reason.

like image 71
Hans Jespersen Avatar answered Oct 18 '22 01:10

Hans Jespersen