JMS Queues are not message stores.
If you have a "bad message" for which processing continues to fail, then the JMS server (if configured) will inevitably drop this message into the "dead message queue", which will slowly fill up until another process depletes it.
You donโt want bad messages in the queue, since they can potentially block the queue (imagine that you have 10 users, and the top 10 messages are bad, so all processes continue, messages stop the queue).
So, you need some kind of mechanism for storing messages in the exception receiver, where later they can be introduced into the main queue for processing.
The dead message queue is not this mechanism (do not store messages in the JMS queue), rather it may be a mechanism for exclusive ROUTE messages for a more permanent storage area (i.e. db table or something else).
After that, they can be checked (automatically, manually, independently) and either re-added or canceled.
But the key point is the need for an external mechanism for this, the JMS server itself is not suitable for such messages.
Will hartung
source share