Skip to content

Instantly share code, notes, and snippets.

@xxx
Forked from yashpatil/JolokiaCommands.md
Created February 10, 2017 23:08
Show Gist options
  • Save xxx/07b6d7ea669dee4add03feb4fd756a0e to your computer and use it in GitHub Desktop.
Save xxx/07b6d7ea669dee4add03feb4fd756a0e 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