我们从 ActiveMQ Classic 升级到 ActiveMQ Artemis,我们面临的一项挑战是通过 Jolokia 监控 OpenWire 客户端的数量。
ActiveMQ Classic 报告连接信息,很容易解析出 OpenWire 客户端的数量。在 ActiveMQ Artemis 中如何做到这一点?
listConnections
管理操作将为您提供您想要的信息。它通过 Jolokia 公开(就像所有管理方法一样)。例如,您可以通过 curl
调用它,然后解析结果,例如通过 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'