处理这些信息的最简单方法是使用默认安装的Jolokia。要做到这一点,使用HTTP客户端发出GET请求以下URI之一:
http://localhost:8161/api/jolokia/search/*:destinationType=Queue,*
http://localhost:8161/api/jolokia/search/*:destinationType=Topic,*
您需要在JMX用户名和密码来传递(默认:行政/管理)作为HTTP的一部分请求。该系统将与沿东西线回应:
{
"request" : {
"mbean" : "*:destinationType=Queue,*",
"type" : "search"
},
"status" : 200,
"timestamp" : 1478615354,
"value" : [
"org.apache.activemq:brokerName=localhost,destinationName=systemX.bar,destinationType=Queue,type=Broker",
"org.apache.activemq:brokerName=localhost,destinationName=systemX.foo,destinationType=Queue,type=Broker",
"org.apache.activemq:brokerName=localhost,destinationName=ActiveMQ.DLQ,destinationType=Queue,type=Broker"
]
}
上面显示了队列systemX.foo
,systemX.bar
,ActiveMQ.DLQ
。下面是一个使用curl
命令这个示例:
curl -u admin http://localhost:8161/api/jolokia/search/*:destinationType=Queue,* && echo ""
有关如何使用API的椒,指the documentation一个很好的解释。