處理這些信息的最簡單方法是使用默認安裝的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一個很好的解釋。