Spring JMS ActiveMQ - Listener Consumers getting hung or stuck after sometime i.e. the instances stop's consuming messages from AMQ after running for a while...
On analyzing Thread Dump, we found following listener thread in parked status -
"Listener-1" #51 prio=5 os_prio=0 tid=0x00007fbc85599800
nid=0x2d016 waiting on condition [0x00007fbb3cc89000]
java.lang.Thread.State: WAITING (parking)
at
sun.misc.Unsafe.park(Native Method)
- parking to wait
for <0x00000000b1da9348> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at
java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:403)
at org.apache.activemq.transport.FutureResponse.getResult(FutureResponse.java:48)
Thus, messages were not getting consumed. The behavior was observed when bulk messages were produced, and Lag increased.
It was hard to determine cause. But, we found a related bug which might be the reason for issue - https://issues.apache.org/jira/browse/AMQ-6763
The work around mentioned in bug i.e. to set jms.prefetchPolicy.all=1 did not work for us.
Solution-
We finally realized that our environment was - Java 8 with AMQ Client 5.16.6 (classic). So, we ended up upgrading environment to Java 11 with AMQ JMS Artemis Client 2.28.0, which fixed our issue.
Comments
Post a Comment