When does the Apache Kafka client throw a “Batch Expired” exception?

This exception indicates you are queueing records at a 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 … Read more