Question

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 ?

Was it helpful?

Solution

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)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top