ActiveMQ 的接收者:无法检索队列中的内容

Receiver of ActiveMQ: not able to retrieve whats in the Queue

我已经执行了下面提到的hello world程序link.. http://www.coderpanda.com/jms-example-using-apache-activemq/另外,我已经下载了提到的ActiveMQ jar和相关文件。我也能够编译和 运行 所有 java 文件。请注意,接收器 java 文件编译成功,但当接收器执行时,控制台上不会生成任何输出消息。发送到队列的消息未被检索。我可以看到每次点击(托管在本地主机 url 上)时 ActiveMQ UI 上的消息计数增加,但放入队列的消息尚未 printed/retrieved。任何人都可以为发布者订阅者建议任何其他实现(如果有的话)吗?或者您对 JMS Q 的看法...

Vihar 的回答是正确的。

When you see a message dequed count increasing, then it is clear that message is successfully consumed by some consumer, and on running of your receiver, why did your consumer count increase in queue? Are there multiple instances? Or you haven't closed the connection properly

我没有关闭连接,消费者在我 运行 多次接收消息时消耗了队列中的消息,直到我 运行 它一次,我才知道它为什么以及如何发生一次在队列中保持一个标签。