Search code examples
javaapache-kafkaspring-kafka

SpringKafka handling retry failures


We consider using spring kafka non-blocking retries. Everything is quite straightforward and looks nice: if exception is thrown inside annotated @KafkaListener method, configured KafkaTemplate sends failed message to predefined retry topic. But one thing that I didn't find - what happens if sending to retry topic fails for some reason (temporary connectivity issue with broker, for example), how we should handle errors inside retry mechanism? So far I found only tuning Producer retries, but perhaps there is better way? Thanks


Solution

  • If the send fails, normal (blocking) retry logic applies; by default, the error handler will perform a seek so that the failed record will be redelivered.