【发布时间】:2014-08-14 16:11:52
【问题描述】:
我尝试了下面的代码来获取 ActiveMQ 中的队列列表。但它不工作。我的 ActiveMQ 中有 4 个队列。
try {
ActiveMQConnection.makeConnection(URL).start();
Set<ActiveMQQueue> allque= ActiveMQConnection.makeConnection().getDestinationSource().getQueues();
Iterator<ActiveMQQueue> itr= allque.iterator();
while(itr.hasNext()){
ActiveMQQueue q= itr.next();
System.out.println(q.getQueueName());
}
} catch (Exception e) {
e.printStackTrace();
}
请让我知道我的代码中的任何更正或一些新代码来完成它。
【问题讨论】:
-
您使用该代码会遇到哪些错误和/或 putput?
-
我没有收到任何错误或异常,也没有收到任何输出。