Hi Tim, Thanks for replying! My question is why the dispatch queue getting filled up even when I'm explicitly acknowledging a message. I have 10 consumers that listen, consume and do everything that they are intended for. Around midnight, when the events posting count increases, the queue starts getting filled up and I need to restart the server in the morning and then everything gets consumed. *Regarding the message group link*, I'm not closing any consumer. All 10 consumers are alive throughout the period when the server is up. *Regarding your statement*, "So I'd expect that when you're down to only 2-3 consumers, all of the message groups would be assigned to those consumers, and they'd be getting messages dispatched to them", I checked and found out that the most of the pending message's JMSXGroupId is same as the consumers that had already consumed messages with same JMSXGroupId. So these messages are not being forwarded to other consumers and wait to be delivered to those consumers only.
*Regarding your statement*, "Did you tweak anything that would affect the broker's ability to detect a disconnected consumer, such as TCP timeout settings, the inactivity checking within ActiveMQ, etc.", the only change I did in configuration file was to add schedulerSupport = "true" for broker. Also for receiving a message, the consumers are using *receive()* method without any parameter. *Regarding your statement*And is there anything unusual in the broker or consumer logs that might shed any light onto what's going on?", the last log for the cons1 is "INFO [2019-03-27 05:56:17,448] com.tinkerix.talkmore.core.ActiveMQConsumer: retrieving a new message from queue for consumer ID:ip-XX-X-X-XXX-XXXXX-1553602691234-1:10:1:1". (Time is in UTC and this reply posting time is 2019-03-27 06:45:06). After this log statement, I have a call consumer.receive() method and that's where the consumer is stuck. The broker is not directing any message to consumer as the disptach queue is at 1. The attached images and the above analysis are of the same period. *Regarding the details of configuration: * Apache ActiveMQ 5.15.8 OpenWire protocol Not checking inactivity of consumers. Earlier, I used to put consumers on sleep when I was using *receive(1000L)* method, but I discarded that and the sleep code both. I tested that if the connection is lost while receiving a message then JMSException is thrown so I handle that and reestablish the connection for that consumer. But this is not happening i.e. the connection failure (I checked cloudwatch logs). I had spawned 10 threads that set up the connection with the broker using the same configuration. I am using AmazonMQ as broker service support for ActiveMQ. 7-8 consumers are still connected. Please refer the attachments. I tried setting the prefetch as ZERO and the attached images are with the prefetch set as zero. On setting prefetch as zero, the dispatch queue is again filling up with upper bound value 1. To create a consumer, I have the following code: ActiveMQConnectionFactory activeMQConnectionFactory = activeMQ.getActiveMQConnectionFactory(); MessageConsumer consumer = getConfiguredConsumerConnection(activeMQConnectionFactory, queueName); The prefetch value is set in getConfiguredConsumerConnection method. It looks like getConfiguredConsumerConnection() { ActiveMQPrefetchPolicy activeMQPrefetchPolicy = new ActiveMQPrefetchPolicy(); activeMQPrefetchPolicy.setQueuePrefetch(0); connectionFactory.setPrefetchPolicy(activeMQPrefetchPolicy); //createConnection //startConnection consumerConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE); //session creation //createConsumer and return MessageConsumer object; } For connection, I'm using AmazonMQ's OpenWire Endpoint. ConsumerFilledUpAfterPrefetchSetTo0.jpg <http://activemq.2283324.n4.nabble.com/file/t379351/ConsumerFilledUpAfterPrefetchSetTo0.jpg> QueueSizeIncresingImage.jpg <http://activemq.2283324.n4.nabble.com/file/t379351/QueueSizeIncresingImage.jpg> -- Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html