Description
Discussed in #2455
Originally posted by jgslima October 20, 2022
Documentation reference: link.
"In combination with the global retryable topic’s fatal exceptions classification, you can configure the framework for any behavior you’d like, such as having some exceptions trigger both blocking and non-blocking retries, trigger only one kind or the other, or go straight to the DLT without retries of any kind."
I was not able to understand how to configure something like this:
- activate blocking retries for exceptions of type
RuntimeException
(which I have done by makingblockingRetries.retryOn(RuntimeException.class)
); - but configuring some specific sub-classes of
RuntimeException
to go directly do DLT. For that, I tried to add them inmanageNonBlockingFatalExceptions()
.
But, as far as I can verify here, exceptions added to manageNonBlockingFatalExceptions()
, are used to skip just the "non blocking" retries, not the blocking ones. For example, when just making blockingRetries.retryOn(RuntimeException.class)
if the listener throws a MessageConversionException
(which is a pre-defined fatal exception) it goes through the blocking retries (and after that, it correctly skips the non blocking retries). This is not in accordance to the example code of the documentation, in regard to ShouldSkipBothRetriesException
.
Also, I think the documentation above is a bit confusing. In the code example "Here’s an example with both configurations working together:", I do not understand how the behaviour for ShouldRetryOnlyBlockingException
and ShouldRetryViaBothException
would be different, because both are just being passed in blockingRetries.retryOn()
.
Thank you.