This is my route
from("myComponent:entity?from=&to=")
.to("seda:one")
from("seda:one")
.
.
to("seda:two")
.
.
.
from("seda:five")
.to("myComponent2:entity")
The flow from 'seda:one' to 'seda:two' is pretty quick and completes way before the other routes. But even though I kill the particular route, I can still see parked threads when inspecting with visual VM. My use case is based on dynamic queues, and I plan to run n number of the same routes parallely with different seda queues. Can someone help me on explaining what this parked thread is, and how I can shutdown the route/queues in the component as soon as I'm done with it. I have referred to a lot of articles, and I feel that I might be missing something very trivial. Any help would be greatly appreciated.
In Visual VM, after my process is over, I can still see parked threads for every seda I have used in my route.
This is the relevant part of the thread dump
"Camel (camel-1) thread #7 - seda://one" #53 daemon prio=5 os_prio=31 tid=0x00007fa8b389c800 nid=0x8003 waiting on condition [0x0000700007be3000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006c0678348> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:176)
at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- <0x00000006c0678460> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"Camel (camel-1) thread #6 - seda://two" #52 daemon prio=5 os_prio=31 tid=0x00007fa8b016c800 nid=0x8203 waiting on condition [0x0000700007ae0000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006c07d2090> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:176)
at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- <0x00000006c0770e10> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"Camel (camel-1) thread #5 - seda://three" #51 daemon prio=5 os_prio=31 tid=0x00007fa8ada31800 nid=0x8303 waiting on condition [0x00007000079dd000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006c0639cc0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:176)
at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- <0x00000006c0639dd8> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"Camel (camel-1) thread #4 - seda://four" #50 daemon prio=5 os_prio=31 tid=0x00007fa8ae2a9800 nid=0x8403 waiting on condition [0x00007000078da000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006c06d7c50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:176)
at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- <0x00000006c06d7d68> (a java.util.concurrent.ThreadPoolExecutor$Worker)
"Camel (camel-1) thread #3 - myComponent2:entity" #49 daemon prio=5 os_prio=31 tid=0x00007fa8b1184800 nid=0x7803 waiting on condition [0x00007000077d7000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006c06dcba8> (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.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- None
"Camel (camel-1) thread #2 - seda://new_test" #48 daemon prio=5 os_prio=31 tid=0x00007fa8b4d23800 nid=0x8703 waiting on condition [0x00007000076d4000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000006c06dd560> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:176)
at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:130)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- <0x00000006c06dd678> (a java.util.concurrent.ThreadPoolExecutor$Worker)