Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveMQ view raw message data in web console

Tags:

activemq

I'm using the web console against my AMQ 5.2 instance successfully, except for I cannot see the content of all of my messages.

If I send a test message using the web console, I can see the sample text content, but I believe the vendor app I am working with has binary or byte array message content.

Is there something I need to do to be able to view this raw data?

Thanks,

like image 839
Robert Brown Avatar asked May 16 '11 04:05

Robert Brown


1 Answers

To my knowledge, it is not possible to inspect messages in the Admin Console. You can get some statistics (like how many messages have been sent etc.). ActiveMQ does not unmarshal messages when receiving them (for performance reasons, unmarshalling is rather expensive).

Thus, if you want to have some way to inspect messages for their content, you can basically do 2 things:

  1. Write a consumer which registers for all topics/queues, through which you can see messages' content. Drawback: if you're using queue-based interaction, your "real" consumers will not get all messages
  2. Write an activeMQ plugin which looks at the messages. Have a look at ActiveMQ's Logger Plugin. Then write your own (you'll need the sources to compile it) and load it with ActiveMQ (see the documentation on how to configure ActiveMQ to load plugins). You want to override the send() method which is called whenever someone sends a message to the broker. There you get a reference to the message and can access its content.

Neither of the two messages provides a convenient viewing-mechanism though. You'll have to resort to standard out, or write your own web-based access.

like image 187
SirRichie Avatar answered Sep 20 '22 23:09

SirRichie