通过 Jolokia 获取 OpenWire 连接数

问题描述 投票:0回答:1

我们从 ActiveMQ Classic 升级到 ActiveMQ Artemis,我们面临的一项挑战是通过 Jolokia 监控 OpenWire 客户端的数量。

ActiveMQ Classic 报告连接信息,很容易解析出 OpenWire 客户端的数量。在 ActiveMQ Artemis 中如何做到这一点?

activemq-artemis
1个回答
0
投票

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'
© www.soinside.com 2019 - 2024. All rights reserved.