How are DefaultErrorHandler and RetryTopicConfiguration/Builder related? Can they work together or does one take precedence over the other?
I am trying to setup my consumption such that
- Retry a certain number of times (
FixedBackOff(attempts = 3, interval = 5s)) - Use a single topic for retry (
RetryTopicConfiguration.useSingleTopicForFixedDelaysworks) - Customize the name of the retry topic (say
main-topic-name.retry). Have not found any class/method that lets me do that. - If the retries are exhausted, then post to a dead letter with a customized name (
main-topic-name.deadLetter).DeadLetterPublishingRecoverersecond parameterBiFunctionshould work but looks like the DL topic has to created beforehand. Not entirely sure.
Observations
- If I use
DeadLetterPublishingRecovererwithout retry related property configuration, I am able to retry with the hard-codedFixedBackOff(return new DefaultErrorHandler(recoverer, new FixedBackOff(5000, 3));) - If I use
DeadLetterPublishingRecovererwith retry related property configuration, the above hard-coded backoff is overridden. I am puzzled how the override happens even though I am supplying a configured error handler instance. - By using
DeadLetterPublishingRecovereronly, I don't get a separate retry topic. - By using
RetryTopicConfiguration(with or without recoverer), I get a retry topic, not with the name I want but default one. However, the dead letter topic used is not mine, the one supplied inDeadLetterPublishingRecovererbut the default one (....-dlt)
I am hoping people would have come across this and have a found a solution to the way I intend to setup my consumption (numbered list above).
Help appreciated