javaspringactivemq-classicspring-jmsmessage-listener

How to retrieve message after last retry in a JMS, ActiveMQ and SimpleMessageListenerContainer setup?


I have a Spring JMS, ActiveMQ setup where I use SimpleMessageListenerContainer which I associated with POJO message listener. I have defined a RedeliveryPolicy where if there are exceptions in POJO message listener the message is send to DLQ after 4 tries. I would like to have access the message after the retries are exhausted, is it possible to with SMLC? What about DefaultMessageListenerContainer?


Solution

  • You need another container listening on the DLQ.

    Or you can use JmsTemplate.receive() on the DLQ to get them on-demand.