1

What is considered the best approach to deal with a JMS message that is causing an exception in a message queue?

What I have done is to setup a DLQ for a specific queue. I will retry to process the message 5 times with a retry delay of 30 seconds. If the message can't be processed it's probably due to some bug - and I move the message to my persistent DLQ. So the idea is then to deploy a bug fix, and then to put the messages in the DLQ back onto the queue.

Is this the best way of doing this? And if so, how do I go about "republishing" my messages that are in the DLQ ?

Zaki
  • 6,997
  • 6
  • 37
  • 53
ChristiaanP
  • 655
  • 6
  • 20

1 Answers1

3

I think it's the best approach.

A supervisor should check DLQ, fix bugs, and send it back to the main queue. You can use jms QueueBrowser to inspect the messages (including message text, jms-id, and ...) in a queue. So you should write a program to list all messages in DLQ. The supervisor should be able to manipulate message text, and send it back to the main queue (delete it from DLQ: consume the message by jms-id, and produce fixed message to the main queue)

Community
  • 1
  • 1
Arya
  • 2,809
  • 5
  • 34
  • 56
  • 2
    Besides.. it really depends on your use case.. in some cases the message means nothing after a certain period.. so, maybe you should just delete the DLQ. By all means don't let message accumulate on the DLQ. consume them or set the DLQ address to page. – Clebert Suconic Oct 28 '13 at 14:01