Search code examples
activemq-artemis

Get number of OpenWire connections via Jolokia


We upgraded from ActiveMQ Classic to ActiveMQ Artemis and one challenge that we have is monitoring the number of OpenWire clients via Jolokia.

ActiveMQ Classic reported connection info and it was easy to parse out the number of OpenWire clients. How does one do that in ActiveMQ Artemis?


Solution

  • The listConnections management operation will give you information you want. It is exposed via Jolokia (just like all management methods). You can invoke it, for example, via curl and then parse the result, for example, via jq:

    curl -s -H "Origin: http://localhost" -u myUsername:myPassword "http://localhost:8161/console/jolokia/exec/org.apache.activemq.artemis:broker=\"0.0.0.0\"/listConnections/\{\"field\":\"protocol\",\"operation\":\"EQUALS\",\"value\":\"OPENWIRE\"\}/1/10" | jq '.value | fromjson | .count'