Closed
Description
Description
In some cases you know that it is useless to retry again and you can use the UnrecoverableMessageHandlingException
.
However, you have no way to do the opposite: retry indefinitely until your message is successfully handled.
For example
My handlers can fail due to various exceptions but for a specific one (let's call it RetryLaterException
) I want to retry until the message is successfully handled.
I can try to implement a RetryStrategy
which looks like this
- the message needs to be "re-delivered" due to a
RetryLaterException
: always retry with a constant delay - else: use the
MultiplierRetryStrategy
but this is not possible because you don't have access to the exceptions inside theRetryStrategyInterface
.
Some ideas
- add an event listener to handle this case before the
SendFailedMessageForRetryListener
. This requires theWorkerMessageFailedEvent
to support thestopPropagation
method. - add a stamp that you can look for in your custom
RetryStrategy
. Currently, there is now way to add a stamp when an exception is thrown. When an exception is thrown in theHandleMessageMiddleware
, it is directly caught by theWorker
. - send the message to a different transport with a different
RetryStrategy
for some specific exceptions