Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kafka Producer error Expiring 10 record(s) for TOPIC:XXXXXX: 6686 ms has passed since batch creation plus linger time

Tags:

apache-kafka

Kafka Version : 0.10.2.1,

Kafka Producer error Expiring 10 record(s) for TOPIC:XXXXXX: 6686 ms has passed since batch creation plus linger time
org.apache.kafka.common.errors.TimeoutException: Expiring 10 record(s) for TOPIC:XXXXXX: 6686 ms has passed since batch creation plus linger time
like image 703
Raju Avatar asked Oct 14 '17 23:10

Raju


2 Answers

This exception is occuring because you are queueing records at a much faster rate than they can be sent.

When you call the send method, the ProducerRecord will be stored in an internal buffer for sending to the broker. The method returns immediately once the ProducerRecord has been buffered, regardless of whether it has been sent.

Records are grouped into batches for sending to the broker, to reduce the transport overheard per message and increase throughput.

Once a record is added into a batch, there is a time limit for sending that batch to ensure that it has been sent within a specified duration. This is controlled by the Producer configuration parameter, request.timeout.ms, which defaults to 30 seconds.

If the batch has been queued longer than the timeout limit, the exception will be thrown. Records in that batch will be removed from the send queue.

Producer configs block.on.buffer.full, metadata.fetch.timeout.ms and timeout.ms have been removed. They were initially deprecated in Kafka 0.9.0.0.

Therefore give a try for increasing request.timeout.ms

Still, if you have any problem related to throughput, you can also refer following blog

like image 137
arglee Avatar answered Sep 26 '22 06:09

arglee


I had same message and I fixed it cleaning the kafka data from zookeeper. After that it's working.

like image 28
Ariel Carrera Avatar answered Sep 22 '22 06:09

Ariel Carrera