Retry mechanism for Kafka Consumer

84 Views Asked by At

Here's a reformatted version of your Stack Overflow question:

I am already familiar with how the @Retry annotation from Resilience4j works for synchronous functions, but I'm unsure of how to design an Auto Retry mechanism for Kafka calls. Here's the scenario:

  1. I need to publish a message to Kafka on topic_1.
  2. The message is consumed by an external service.
  3. The external service sends a callback on topic_2.
  4. Based on the callback event received on topic_2, we decide whether to republish the message to topic_1 or not.

I'm looking for guidance on how to implement Auto Retry for Kafka calls in this scenario. Is there a framework available that can help with this, or should I implement it myself? Any insights or examples would be greatly appreciated.

EDIT: One more question, @Retry block the current thread for the time until all retry attempts are exhausted ? I couldn't find this anywhere in documentation.

0

There are 0 best solutions below