Loading...

Jolokia - JMX with JSON over HTTP

:heavy_exclamation_mark: This post is older than a year. Consider some information might not be accurate anymore. :heavy_exclamation_mark:

Used:   jolokia 1.3.1 

Jolokia is remote JMX with JSON over HTTP. It provides several agents to expose JMX MBeans. OSGi is one of them :smile:. Using DropWizard Metrics with the JmxReporter, you can easily access the metrics. If you use the Java EE agent (deploy the jolokia.war to your Java EE application server), it enables you to access the metric under the given MBeans objectName, e.g. The context-root can be simplified to jolokia via the web.xml.

curl http://localhost:8080/jolokia-war-1.3.1/read/metrics:name=trx.process.approved
  • read is the operation
  • metrics:name=trx.process.approved the JMX objectName of the MBean

Example output of processed transaction that haven been approved.

{
    "request": {
        "mbean": "metrics:name=trx.process.approved",
        "type": "read"
    },
    "value": {
        "Count": 2
    },
    "timestamp": 1434618683,
    "status": 200
}
Please remember the terms for blog comments.