This is supported only for the point-to-point scenarios.
The JMS Provider attempts to deliver a message to a consumer until the message delivery is acknowledged. This behavior can be problematic in cases when a particular message repeatedly cannot be delivered, since this leads to an endless loop.
For example, a message-driven bean (or an asynchronous consumer) reproducibly throws a RuntimeException while processing a particular message. This could happen due to an application programming error, or because there is corrupt data in the message. The JMS Provider will attempt to deliver the message again, but the problem may persist, so that the application is trapped in an endless loop.
You can limit the number of attempts to deliver a message. When this limit is exceeded, the message is considered undeliverable (dead message), and it is automatically sent to a dead message queue.