Grails 中的 ActiveMQ 列表队列
ActiveMQ list queues in grails
我对 grails 中的 activemq 有疑问。
我想从 activemq 获取所有队列。在我将活动 mq 服务器更新到版本 5.13.0 之前,我的方法工作正常
现在我的代码不再起作用了。
这是我的代码:
def connect = JMXConnectorFactory.connect(jmxUrl,env)
def server = connect.MBeanServerConnection
def allQueues=[]
def query = new ObjectName('org.apache.activemq:BrokerName=localhost,type=Broker,destinationType=Queue,destinationName=*')
def queues = server.queryNames(query, null )
queues.each {
allQueues.add(it.getKeyProperty("Destination"))
}
我已经按照http://activemq.apache.org/activemq-580-release.html
中的说明更改了 ObjectName
但是队列总是空的。
这里有什么问题?
找到解决方案,BrokerName 错误,正确的是 brokerName。
def query = new ObjectName('org.apache.activemq:brokerName=localhost,type=Broker,destinationType=Queue,destinationName=*')
我对 grails 中的 activemq 有疑问。 我想从 activemq 获取所有队列。在我将活动 mq 服务器更新到版本 5.13.0 之前,我的方法工作正常 现在我的代码不再起作用了。
这是我的代码:
def connect = JMXConnectorFactory.connect(jmxUrl,env)
def server = connect.MBeanServerConnection
def allQueues=[]
def query = new ObjectName('org.apache.activemq:BrokerName=localhost,type=Broker,destinationType=Queue,destinationName=*')
def queues = server.queryNames(query, null )
queues.each {
allQueues.add(it.getKeyProperty("Destination"))
}
我已经按照http://activemq.apache.org/activemq-580-release.html
中的说明更改了 ObjectName但是队列总是空的。 这里有什么问题?
找到解决方案,BrokerName 错误,正确的是 brokerName。
def query = new ObjectName('org.apache.activemq:brokerName=localhost,type=Broker,destinationType=Queue,destinationName=*')