0

I have read When does the Apache Kafka client throw a "Batch Expired" exception?, but I feel like I'm missing something.

For my program I don't need high throughput, so I've created a "blocking" write:

kafkaProducer.send(record).get();

Why would this give me a batch expired error sometimes?

java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for test2-0: 42084 ms has passed since batch creation plus linger time
kyl
  • 475
  • 1
  • 5
  • 16
  • Sync or async - batching does happen. In this case the batch size is 1. There must be a reason why the request is failing - maybe due to connection issues ? What your config for `linger.ms` and `retries` ? – Abhishek May 28 '17 at 12:39
  • Oh I see, this could happen due to a connection issue - it batches ok, but doesn't manage to send it to the queue. The linger.ms and retries are not set, so it's using defaults. I'll try increasing them and see if this happens again. Thanks! – kyl May 29 '17 at 14:06

0 Answers0