2

I am reading now that Jolokia can act as a medium to command and manage ActiveMQ 5.8+ through a restAPI (GET/POST commands).

I am failing to find any references on what the specific commands are to (for example):

  1. Get a list of active queues
  2. Get a list of customers for each queue
  3. Pause a queue
  4. Delete a queue
  5. Restart a queue

Etc, Etc.

If there is no official reference, how does anyone figure out how to do this? Is there some mapping to the JMX commands to the Jolokia commands? If so, what is that mapping?

E.S.
  • 2,733
  • 6
  • 36
  • 71

1 Answers1

4

The API is the JMX API that ActiveMQ exposes.

For practical examples you can try using hawtio (http://hawt.io/) in ActiveMQ and then use (if you use chrome but other browsers may have plugins) right click -> Inspect Element -> Network. Then you can see all the network access and thus the HTTP GET/POST that hawtio does to access jolokia to grab the data / do the operations.

Notice hawtio comes out of the box in ActiveMQ 5.9, so its easy to get started with.

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
  • Interesting idea, just download 5.9 and playing around with it now. I am on a work computer and restricted on web browsers, but I do have Firebug Lite (on a version of firefox that doesn't allow actual add ons). Hopefully I can extract the Jolokia commands that way. – E.S. Oct 23 '13 at 18:05
  • This solution is looking more promising. I found out how to get firebug working on my version of FF and here is what I see to remove a queue: {"type":"exec","mbean":"org.apache.activemq:type=Broker,brokerName=localhost","operation":"removeQueue(java.lang.String)","arguments":["MY_QUEUE_NAME"]} Its the end of the day here, I'll probably get a chance to dig more into this on Monday. – E.S. Oct 25 '13 at 00:50
  • Fantastic! It worked. I did need a little help learning how to work the hawtio/jolokia system through Java (this question helped http://stackoverflow.com/q/19736856/1582712) but I am good! – E.S. Nov 04 '13 at 20:13