Search code examples
activemq-classicspring-jmsjmstemplate

Can message we are pushing to a Queue be moved to Active MQ Dead Letter Queue (DLQ) if any exception/connection error occur?


i am using Spring JmsTemplate for sending/pushing message to ActiveMQ queue. i know after listener start processing that message and any exception occur,that message will be considered as a poison pill and moved to default DLQ of acive mq.

is that same possible (i.e. that message will move to default Dead Letter Queue ) while sending/pushing that message to Queue if there is any connection error or any other error occured while sending?

for example -

public void push(){

jmsTemplate.send(test.Queue, "This message is from client"); //if any exception occur here,i want this message to be placed in DLQ }

please suggest is it possible?


Solution

  • If you can't connect to send it the main queue, you probably can't connect to send it to the DLQ either.