ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages

梦想与她 提交于 2019-12-13 05:48:13

问题


We have a use case wherein we create just one consumer to process messages in the Queue. Message processor accumulates certain number of messages before acknowledging. Receiving messages in Asynchronous way and using Transacted session. Size of message is very small.

Active MQ stops sending further messages to sole consumer after certain number of messages and waits for acknowledgement. We have tried solutions like consumer.prefetchSize, consumer.maximumPendingMessageLimit; but nothing is working. We tried similar use case with a durable topic with just one subscriber and it works fine.

Has anyone encountered similar activemq issue/behavior? We tried many things mentioned on different forums but none of them helped.

Activemq version : ActiveMQ 5.6.0
Queue configuration : Durable queue
Consumer : Asynchronous and uses transacted session as acknowledgement mode

Any help or suggestion will be greatly appreciated. Thanks.


回答1:


I had tried out lot of different configurations to resolve this issue by setting different activemq attributes like prefetch policy, maxpagesize etc. but none of them really helped. By referring to @Jake's comment I got to know about monitoring activemq using JMX via JConsole. This is a very handy tool to monitor and manage your activemq. Here are few article which you may find useful.
1. Monitoring activemq
2. Connecting activemq JMX using JConsole

By monitoring the queue attributes I figured out that memoryLimit attribute had very low value assigned to it (just 1mb). Increasing the value of the attribute solved my issue. JMS started sending messages without waiting for acknowledgement.

For testing purpose I had changed the value for memoryLimit in the conf/activemq.xml configuration file.



来源:https://stackoverflow.com/questions/17972270/activemq-stops-sending-messages-to-queue-consumer-in-case-of-consumer-not-acknow

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!