ActiveMQ 消费者挂起 [英] ActiveMQ Consumer Hangs
问题描述
我有一个使用 SSL 传输的 activeMQ 代理.我有大约 10 个使用代理的消费者.我正在使用骆驼来配置我的路线.
I have an activeMQ broker using an SSL transport. I have about 10 consumers that are using the broker. I am using camel to configure my routes.
每隔一段时间,它就会挂断并且不会消费新消息,即使我重新启动消费者,即使队列中有待处理的消息.
Every so often, it hangs up and will not consume new messages, even if I restart the consumers, even though there are messages pending in the queues.
我开始尝试通过逐个遍历我的消费者来尝试复制问题来隔离发生这种情况的地方.我终于找到了一个可以重现问题的消费者.它会在一段时间后挂起,但是,如果我转到活动的 MQ 管理控制台并尝试查看队列中的消息,它将再次开始运行.我认为 Jetty 导致连接发生刷新网页的队列,从而解除我遇到的一些线程问题.我应该如何调试?
I started trying to isolate where this was happening by stepping through my consumers one at a time trying to replicate the problem. I finally got to a consumer that I could re-create the problem on. It will hang after a period of time, however, if I go to the active MQ admin console and try to view messages in the queue, it will start running again. I think that Jetty is causing a connection to happen to refresh the queue for the webpage, and thus unblocking some thread problem I am having. How should I debug this?
谢谢
推荐答案
我的一个同事偶然发现了一个有趣的东西,我刚刚在网上找到了一个解释:http://activemq.2283324.n4.nabble.com/Consumer-is-not-able-to-pick-messages-from-queue-td2531722.html
A colleague of mine stumbled onto something interesting, and I just found an explanation on the internet: http://activemq.2283324.n4.nabble.com/Consumer-is-not-able-to-pick-messages-from-queue-td2531722.html
显然,当您有一个选择器并且所有消息都在同一个队列中时,可以填充页面大小.这发生在我们身上 - 我没有启动消费者,所以我最终得到了一整页带有选择器的消息,用于不同的消费者,这导致我正在运行的消费者没有收到任何额外的工作发送给它.
Apparently there is a page size that can get filled when you have a selector and all the messages are in the same queue. This was happening for us - I hadn't started the consumer, so I ended up with a full page of messages with selectors for a different consumer, and this was causing my running consumer to not get any additional work sent to it.
这篇关于ActiveMQ 消费者挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!