【问题标题】:Queue Consumers have pending messages but they are not getting processed队列消费者有待处理的消息,但它们没有得到处理
【发布时间】:2017-08-07 20:15:39
【问题描述】:

我使用的是activemq、camel和spring的组合。对于队列,我们​​有多个消费者;在某些队列消费者上,我们看到有待处理的消息(最多 100 条,与预取相同),它们根本没有得到处理,但同一队列的其他消费者,一切照旧。

我深入研究以了解正在发生的事情,发现弹簧缓存连接工厂可能导致此问题 - 我们怀疑此缓存连接工厂可能使某些客户端处于非活动状态,并且保留在其预取缓冲区中的消息未得到处理。我们的发现是否正确?

除此之外,还有什么方法可以从非活动消费者释放的预取缓冲区中获取消息?

【问题讨论】:

    标签: apache-camel activemq spring-jms


    【解决方案1】:

    您不能使用具有可变并发性的CachingConnectionFactory,或者您必须禁用消费者缓存;请参阅 DefaultMessageListenerContainer 的 javadocs。

     * <p><b>Note: Don't use Spring's {@link org.springframework.jms.connection.CachingConnectionFactory}
     * in combination with dynamic scaling.</b> Ideally, don't use it with a message
     * listener container at all, since it is generally preferable to let the
     * listener container itself handle appropriate caching within its lifecycle.
    

    否则空闲的消费者将被放入缓存中。

    【讨论】:

    • 谢谢,这也是我们的发现。有没有办法检索卡在非活动消费者处的消息?
    • 否;除非卷再次增加并且消费者已从缓存中检出。
    猜你喜欢
    • 2018-07-13
    • 2013-06-09
    • 1970-01-01
    • 1970-01-01
    • 2015-12-13
    • 2016-05-04
    • 1970-01-01
    • 2012-11-08
    • 1970-01-01
    相关资源
    最近更新 更多