Skip to content

Instantly share code, notes, and snippets.

@eightseventhreethree
Forked from yashpatil/JolokiaCommands.md
Created April 24, 2019 21:00
Show Gist options
  • Save eightseventhreethree/d3588a7dcd9950c34b5c3d287d274d2b to your computer and use it in GitHub Desktop.
Save eightseventhreethree/d3588a7dcd9950c34b5c3d287d274d2b to your computer and use it in GitHub Desktop.
Jolokia URLs for quick access to A-MQ statistics

This is a quick reference to get to Jolokia statistics urls for JBoss Fuse or JBoss A-MQ statistics. Sometimes, when you are interested in very specific attributes, it's easier to keep monitoring a specific url rather than loading the full Hawtio console.

Commonly used MBeans, Objects, Attribute and Operation names for ActiveMQ are available here: http://activemq.apache.org/jmx.html Jolokia reference: https://jolokia.org/reference/html/protocol.html

Note: Unless specifically mentioned, all POST requests are to url http://localhost:8181/hawtio/jolokia

List all MBeans

GET

http://localhost:8181/hawtio/jolokia/list

POST

{ 
   "type":"LIST"
}

Search

GET

http://localhost:8181/hawtio/jolokia/search/org.apache.activemq:*

POST

{ 
   "type":"SEARCH",
   "mbean":"org.apache.activemq:*"
}

Execute Operations

GET

Add a queue

http://localhost:8181/hawtio/jolokia/exec/org.apache.activemq:type=Broker,brokerName=amq/addQueue/MyAwesomeQueue

Purge a queue

http://localhost:8182/hawtio/jolokia/exec/org.apache.activemq:type=Broker,brokerName=amq,destinationType=Queue,destinationName=MyAwesomeQueue/purge

POST

Add a queue
{
    "type":"exec",
    "mbean":"org.apache.activemq:type=Broker,brokerName=amq",
    "operation":"addQueue",
    "arguments":["MyAwesomeQueue"]
}

Purge a queue
{
    "type":"exec",
    "mbean":"org.apache.activemq:type=Broker,brokerName=amq,destinationType=Queue,destinationName=MyAwesomeQueue",
    "operation": "purge"
}

Broker Attributes

GET

Retrieve all attributes

http://localhost:8181/hawtio/jolokia/read/org.apache.activemq:type=Broker,brokerName=amq

Retrieve specific attribute

http://localhost:8181/hawtio/jolokia/read/org.apache.activemq:type=Broker,brokerName=amq/StorePercentUsage

POST

Retrieve all attributes
{
    "type":"read",
    "mbean":"org.apache.activemq:type=Broker,brokerName=amq"
}

Retrieve specific attributes
{
    "type":"read",
    "mbean":"org.apache.activemq:type=Broker,brokerName=amq",
    "attribute":"StorePercentUsage"
}

Queue Attributes

GET

Retrieve all attributes

http://localhost:8181/hawtio/jolokia/read/org.apache.activemq:type=Broker,brokerName=amq,destinationType=Queue,destinationName=MyAwesomeQueue

Retrieve specific attribute

http://localhost:8181/hawtio/jolokia/read/org.apache.activemq:type=Broker,brokerName=amq,destinationType=Queue,destinationName=MyAwesomeQueue/QueueSize

Retrieve more than one attribute

http://localhost:8181/hawtio/jolokia/read/org.apache.activemq:type=Broker,brokerName=amq,destinationType=Queue,destinationName=MyAwesomeQueue/QueueSize,CursorMemoryUsage

POST

Retrieve all attributes
{
    "type":"read",
    "mbean":"org.apache.activemq:type=Broker,brokerName=amq,destinationType=Queue,destinationName=MyAwesomeQueue"
}

Retrieve specific attribute
{
    "type":"read",
    "mbean":"org.apache.activemq:type=Broker,brokerName=amq,destinationType=Queue,destinationName=MyAwesomeQueue",
    "attribute":"QueueSize"
}

Retrieve more than one attribute
{
    "type":"read",
    "mbean":"org.apache.activemq:type=Broker,brokerName=amq,destinationType=Queue,destinationName=MyAwesomeQueue",
    "attribute":["QueueSize","CursorMemoryUsage"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment