I've got this scenario:
- a JMS message elaboration via an MDB might fail (throws a
RuntimeException
in this case) - the message should be redelivered, though after a delay (ideal, but not strictly necessary: after an increasing delay depending on the number of fails)
- after x failures, the message should be disregarded and never sent again
Right now, the behaviour I have is that the failed message is redelivered instantly for 10 times, and I haven't been able to customize this.
Is there a way I can achieve this via @JMSdefinition
(or other annotations as well) or setting the correct properties in the message? If so, how to do?