简体   繁体   中英

How do we analyze messages in Dead Letter queue for Activemq

The Broker then takes the message and sends it to a Dead Letter Queue so that it can be analyzed later on.

These are the quotes from apache activemq article. My strategy is also the same. I want to analyze the messages in dead letter queue later. How can I do that?

The Dead Letter Queue (DLQ) is just like any other Queue in that you can subscribe to it and consume the messages using a JMS MessageConsumer or QueueBrowser. With that you can take a message from the Queue and inspect it as you would any other message. The current ActiveMQ client will usually add a poison cause to the message store in the message property "dlqDeliveryFailureCause" which can indicate what caused the message to be discarded.

Of course if you are looking in the WebConsole you can view the messages in the DLQ that way as well and inspect the properties of the message.

Essentially the whys and hows of the analysis are up to you, the broker gives the means to retrieve the messages, how you make sense of them is up to you.

I made a simple open source command line tool, called A , to manually deal with DLQ messages among other things.

This command will write browse the content of one message to a file for further inspection.

a -b tcp://example.org:61616" -c 1 -o msg-data.txt ActiveMQ.DLQ

A common way to deal with DLQ messages is to be able to handle them from some admin view of the system. Like inspect content, correlate to error message with options to retry or discard the message. That requires some dev.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM