我有一个连接到ActiveMQ(作为使用者)的Java进程。当我尝试彻底停止它时,它会引起问题。
该过程如下停止:
如果尚未处理任何消息,则该过程似乎可以正常关闭。但是一旦收到消息,该过程就不会停止,而且我不确定为什么(最终的日志消息已打印)
我已经打印了一个线程转储以查看发生了什么,但是我不确定是什么导致了该问题:
Attaching to process ID 17264, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.201-b09
Deadlock Detection:
No deadlocks found.
Thread 20: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Interpreted frame)
- java.lang.ref.ReferenceQueue.remove(long) @bci=59 (Compiled frame)
- java.lang.ref.ReferenceQueue.remove() @bci=2 (Compiled frame)
- sun.java2d.Disposer.run() @bci=3 (Interpreted frame)
- java.lang.Thread.run() @bci=11 (Interpreted frame)
Locked ownable synchronizers:
- None
Thread 19: (state = BLOCKED)
- sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
- java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object, long) @bci=20 (Interpreted frame)
- java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long) @bci=78 (Interpreted frame)
- java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=124 (Interpreted frame)
- java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=1 (Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor.getTask() @bci=149 (Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=26 (Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5 (Interpreted frame)
- java.lang.Thread.run() @bci=11 (Interpreted frame)
Locked ownable synchronizers:
- None
Thread 18: (state = BLOCKED)
- sun.misc.Unsafe.park(boolean, long) @bci=0 (Interpreted frame)
- java.util.concurrent.locks.LockSupport.parkNanos(java.lang.Object, long) @bci=20 (Interpreted frame)
- java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long) @bci=78 (Interpreted frame)
- java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=124 (Interpreted frame)
- java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=1 (Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor.getTask() @bci=149 (Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=26 (Interpreted frame)
- java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5 (Interpreted frame)
- java.lang.Thread.run() @bci=11 (Interpreted frame)
Locked ownable synchronizers:
- None
Thread 17: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Interpreted frame)
- java.util.TimerThread.mainLoop() @bci=201 (Interpreted frame)
- java.util.TimerThread.run() @bci=1 (Interpreted frame)
Locked ownable synchronizers:
- None
Thread 1: (state = BLOCKED)
Locked ownable synchronizers:
- None
Thread 10: (state = BLOCKED)
Locked ownable synchronizers:
- None
Thread 9: (state = BLOCKED)
Locked ownable synchronizers:
- None
Thread 8: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Interpreted frame)
- java.lang.ref.ReferenceQueue.remove(long) @bci=59 (Compiled frame)
- java.lang.ref.ReferenceQueue.remove() @bci=2 (Compiled frame)
- java.lang.ref.Finalizer$FinalizerThread.run() @bci=36 (Interpreted frame)
Locked ownable synchronizers:
- None
Thread 7: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Interpreted frame)
- java.lang.Object.wait() @bci=2 (Compiled frame)
- java.lang.ref.Reference.tryHandlePending(boolean) @bci=54 (Compiled frame)
- java.lang.ref.Reference$ReferenceHandler.run() @bci=1 (Interpreted frame)
Locked ownable synchronizers:
- None
据我所见
ActiveMQ版本: 5.15.4
ActiveMQConnectionFactory网址:故障转移:(tcp:// localhost:61616)?timeout = 3000&maxReconnectAttempts = 10
没有其他特定参数