I'm trying to view the contents of a topic using activemq-admin
.
This is what I'm trying:
./activemq-admin browse --amqurl tcp://localhost:61616 my.topic
This is what I get as output:
Java Runtime: Sun Microsystems Inc. 1.6.0_24 /usr/lib/jvm/java-6-sun-1.6.0.24/jre
Heap sizes: current=62848k free=62190k max=932096k
JVM args: -Dactivemq.classpath=/home/pc/dev/apache-activemq-5.3.1/conf; -Dactivemq.home=/home/pc/dev/apache-activemq-5.3.1 -Dactivemq.base=/home/pc/dev/apache-activemq-5.3.1
ACTIVEMQ_HOME: /home/pc/dev/apache-activemq-5.3.1
ACTIVEMQ_BASE: /home/pc/dev/apache-activemq-5.3.1
Which is not what I want. I want to see the messages in the queue in raw form somehow. Is that possible ?
Thanks,
What Is an ActiveMQ Topic? ActiveMQ topic is a pipeline of messages where a message comes in and goes to every subscriber.
createConsumer("MyQueue"); listener = new MyListener (); consumer. setMessageListener(listener); connection. start(); // At this point, messages should arrive from the queue to your listener.
You cannot browse the contents of topics due to the nature of what a topic is. Messages are sent in, and if there are any subscribers, each receives a message at that point in time. Messages are generally not retained (with some exceptions that aren't relevant here).
However, sometimes for debugging purposes it's useful to see messages that were sent to a topic. The easiest way to do so is to set up a virtual destination, that copies each message sent to the topic into a queue.
<destinationInterceptors>
<virtualDestinationInterceptor>
<virtualDestinations>
<compositeTopic name="events" forwardOnly="false">
<forwardTo>
<queue physicalName="events.thatHaveHappened" />
</forwardTo>
</compositeTopic>
</virtualDestinations>
</virtualDestinationInterceptor>
</destinationInterceptors>
You can then browse the queue via JMX or the web console.
This third-party tool lets you subscribe to topics and inspect the messages to a topic:
http://sourceforge.net/projects/activemqbrowser/
Connect to the server, then subscribe to the topic you want. It worked OK for me to look at the message details and payloads.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With