Skip to content

Instantly share code, notes, and snippets.

@yashpatil
Last active January 6, 2023 14:59
Show Gist options
  • Star 46 You must be signed in to star a gist
  • Fork 15 You must be signed in to fork a gist
  • Save yashpatil/de7437522bfccfeee4cb to your computer and use it in GitHub Desktop.
Save yashpatil/de7437522bfccfeee4cb 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"]
}
@MarcoPalomo
Copy link

You ah starr!! thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment