0

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?

Somnath Goswami
  • 112
  • 1
  • 12

1 Answers1

0

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

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • i agree with what you said Gary. but consider a case where MQ Provider/server is up n running but someone has renamed the Queue @ provider but application client is still trying to connect to Queue with existing name. in this case is it possible to move message to DLQ ? – Somnath Goswami Sep 17 '15 at 13:02
  • You can use Spring Retry to wrap the call to the template and when the retries are exhausted, try to send the message someplace else. – Gary Russell Sep 17 '15 at 13:56
  • Yes we can use Spring Retry but this will move message to some other queue/place and we need to write that logic. but as i mentioned while listening any message is moved automatically to DLQ ,same i want to happen for push operation if its possible. – Somnath Goswami Sep 18 '15 at 07:56
  • No; it's not possible. – Gary Russell Sep 18 '15 at 13:12
  • Thanks for your help and suggestion Gary – Somnath Goswami Sep 21 '15 at 09:10