Spring integration DelayHandler, retryDelay and messageStore

Viewed 59

A Delayer has message store and it provides the ability to not lose messages on the application shutdown. It's working fine for one delay. But if I set retryDelay, the message will be removed from message store at first attempt and will be lost on the application shutdown.

Why it's happen? Why is message not stored in the message store for retry?

1 Answers

I think this is an omission and we really have to store message back on every retry. Please, raise a GH issue as a bug and we will fix it soon.

As a workaround I would suggest to take a look into the ExpressionEvaluatingRequestHandlerAdvice and with its failureChannel and onFailureExpression re-route the message back into your delayer. Probably you might need to incorporate a RequestHandlerRetryAdvice instead of that retryDelay since an internal retry doesn't help us.

See docs for those advises: https://docs.spring.io/spring-integration/docs/5.3.2.RELEASE/reference/html/messaging-endpoints.html#message-handler-advice-chain

And delayer's delayedAdviceChain option.

Related