如何使用 ActiveMQ NMS (.NET) 获取队列和主题列表。在 JAVA 中获取列表很简单。但是.NET 呢?
在java中我使用了这个:
String messageBrokerUrl = "tcp://localhost:61616";
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(
"admin", "admin", messageBrokerUrl);
ActiveMQConnection connection;
connection = (ActiveMQConnection) connectionFactory
.createConnection();
connection.start();
this.session = connection.createSession(this.transacted, ackMode);
DestinationSource ds = connection.getDestinationSource();
Set<ActiveMQQueue> queues = ds.getQueues();
for (ActiveMQQueue activeMQQueue : queues) {
System.out.println(activeMQQueue.getQueueName());
}
.NET 有类似的方法吗?
谢谢。