'Kafka listeners with different retry attempts
I have three spring @KafkaListeners, all consuming from the same topic, but I need to have different retry attempts for each listener which results in having different RetryPolicy I guess.
I am on version 2.7.11 right now; Should I define three different listener container Factories as well or there is a way to handle them on the same listener container factory?
Solution 1:[1]
RetryTemplate in the container factory is deprecated now that error handlers support backoffs and exception classification.
https://github.com/spring-projects/spring-kafka/issues/1886
You can add a container customizer to the factory and set a different error handler (with different back offs) for each container.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gary Russell |
