I do not understand how to handle errornous messages when using a JMS topic. I have a persistent JMS Topic with 4 subscribers. I send a message to the topic. 3 of the subscribers consume the message successfully, one fails. After some retries the message is put in the dead letter queue (DLQ).
The question is, how to continue from there.
-
How can I find out which subscriber failed?
-
How can I redeliver the message only to that subscriber? I cannot just put it into the topic again, since all subscribers would get it then.
Are there some best practices to handle this case?
If that matters, I use Glassfish 3.1.2 with an openMQ. I would prefer to use a solution that is not specific to the implementation of the messaging provider.
Thanks in advance for your answer.
Cheers
Arne
Well, I’m not very familiar with openmq, but a lot of jms providers have an ability to forward messages from topic to queues. So the message producer sends messages to a topic, then jms provider forwards a separate copy of a message to a separate queue for each consumer. Each consumer has its own DLQ.
There are the following benefits: