Spring JMS DefaultMessageListenerContainer线程在isRunning()上处于阻塞状态

时间:2017-07-22 17:45:07

标签: spring-jms

我们的旧项目版本之一是使用带有活动mq 5.10的spring JMS 4.0.2,并且我们发现组件将消息发送到活动mq Q并且其他组件正在接收它。

在大约400多条消息通过之后,下一条消息刚刚停止并且从未到达最终目的地。

我们将它跟踪到接收端,其中spring JMS部分能够获取消息但无法调用" onMessage"听众。

接收JVM的线程转储显示所有收到的消息线程都是" BLOCKED" on' isRunning()'反过来等待锁定" lifecycleMonitor"对象

这是线程转储分析:

在调用" onMessage"之前,收到了5条消息,然后这5条线程正在等待锁定(isRunning())。

85 threads with same stack trace Thread 246 Thread 246 - threadId:Thread 246 - state:BLOCKED stackTrace:
- java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
- java.lang.Object.wait() @bci=2, line=502 (Compiled frame)
- org.apache.activemq.FifoMessageDispatchChannel.dequeue(long) @bci=49, line=72 (Compiled frame)
- org.apache.activemq.ActiveMQMessageConsumer.dequeue(long) @bci=19, line=486 (Compiled frame)
- org.apache.activemq.ActiveMQMessageConsumer.receive() @bci=17, line=573 (Compiled frame)
- org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveMessage(javax.jms.MessageConsumer) @bci=10, line=430 (Compiled frame)
- org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer, org.springframework.transaction.TransactionStatus) @bci=119, line=310 (Compiled frame)
- org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer) @bci=94, line=263 (Compiled frame)
- org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener() @bci=17, line=1102 (Compiled frame)
- org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run() @bci=82, line=996 (Compiled frame)
- org.springframework.scheduling.commonj.DelegatingWork.run() @bci=4, line=62 (Compiled frame)
- de.myfoo.commonj.work.FooWorkItem.run() @bci=112, line=100 (Compiled frame)
- java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=95, line=1142 (Compiled frame)
- java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=617 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=745 (Compiled frame)

38 threads with same stack trace Thread 231 Thread 231 - threadId:Thread 231 - state:BLOCKED stackTrace:
- org.springframework.jms.listener.AbstractJmsListeningContainer.isRunning() @bci=6, line=347 (Compiled frame)
- org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run() @bci=64, line=995 (Compiled frame)
- org.springframework.scheduling.commonj.DelegatingWork.run() @bci=4, line=62 (Compiled frame)
- de.myfoo.commonj.work.FooWorkItem.run() @bci=112, line=100 (Compiled frame)
- java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=95, line=1142 (Compiled frame)
- java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=617 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=745 (Compiled frame)

5 threads with same stack trace Thread 126 Thread 126 - threadId:Thread 126 - state:BLOCKED stackTrace:
- org.springframework.jms.listener.AbstractJmsListeningContainer.isRunning() @bci=6, line=347 (Compiled frame)
- org.springframework.jms.listener.DefaultMessageListenerContainer.scheduleNewInvokerIfAppropriate() @bci=1, line=715 (Compiled frame)
- org.springframework.jms.listener.DefaultMessageListenerContainer.messageReceived(java.lang.Object, javax.jms.Session) @bci=9, line=692 (Compiled frame)
- org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer, org.springframework.transaction.TransactionStatus) @bci=222, line=317 (Compiled frame)
- org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer) @bci=94, line=263 (Compiled frame)
- org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener() @bci=17, line=1102 (Compiled frame)
- org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run() @bci=82, line=996 (Compiled frame)
- org.springframework.scheduling.commonj.DelegatingWork.run() @bci=4, line=62 (Compiled frame)
- de.myfoo.commonj.work.FooWorkItem.run() @bci=112, line=100 (Compiled frame)
- java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=95, line=1142 (Compiled frame)
- java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=617 (Compiled frame)
- java.lang.Thread.run() @bci=11, line=745 (Compiled frame)

2 threads with same stack trace Thread 16 Thread 16 - threadId:Thread 16 - state:BLOCKED

0 个答案:

没有答案