We are facing a random issue with ActiveMQ and its consumers. We observe that only a few consumers do not receive messages, although they are connected to the ActiveMQ queue. But it works fine after rebooting the consumer.
We have a queue called testQueue from ActiveMQ. The consumer is trying to disconnect messages from this queue. For this purpose we use Spring DefaultMessageListenerContainer. The message is delivered to the consumer node from ActiveMQ Broker. From tcpdump, it was also clear that the message reaches the consumer node, but the actual consumer code cannot see the message. In other words, the message seems to be stuck in either ActiveMQ consumer code or Spring's DefaultMessageListenerContainer.
See picture below. for more clarity on this. The message reaches the consumer node, but it does not reach the "Actual consumer class", which means that the message is stuck in either the consumer AMQ code or the Spring DMLC.

The following are data received from the ActiveMQ administrator.
Queue-name / pending-message-counter / consumer-count / messages-in-line / messages-dropped testQueue / 9/1/9/0
See below for more details.
Connection-ID / SessionId / Selector / Enqueues / Dequeues / Dispatched / Dispatched-Queue / Prefetch ID: bearsvir52-45176-1375519181268-3: 5/1 // 9/0/9/9/250
From the second table it is obvious that the messages are delivered to the consumer, but the consumer does not confirm the message. Consequently, messages are stuck in the Sent Queue on the broker's side.
A few points for your notice:
1) Time difference b / w Broker node and consumer node.
2) Watched tcpdump from the consumer. We can see that the MessageDispatch (Openwire) package is being passed to the node consumer, but could not find MessageAck (Openwire) for it.
3) Sometimes it works with node, and sometimes it creates a problem on the same node.
spring-jms activemq
Manohar
source share