Loading...

Jolokia - JMX with JSON over HTTP

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
}