Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.0.1
-
None
-
Unknown
-
Regression
Description
Using Camel 3.0.1 the scheduler/scheduler-thread is no longer shared between routes using the same scheduler name.
Using this test:
public class MultipleRoutesSameSchedulerTest extends CamelTestSupport { @Override protected RouteBuilder[] createRouteBuilders() throws Exception { return new RouteBuilder[] { new RouteBuilder() { public void configure() { from("scheduler:test?delay=1s").log("test1"); } }, new RouteBuilder() { public void configure() { from("scheduler:test?delay=2s").log("test2"); } }, }; } @Test public void test() throws Exception { getMockEndpoint("mock:test").expectedMessageCount(1); assertMockEndpointsSatisfied(100, TimeUnit.SECONDS); } }
Camel 2.23.0 uses the same thread:
22:05:04.698 [Camel (camel-1) thread #1 - scheduler://test] INFO route1 - test1 22:05:05.697 [Camel (camel-1) thread #1 - scheduler://test] INFO route2 - test2
Camel 3.0.1 uses two different threads:
22:03:02.488 [Camel (camel-1) thread #1 - scheduler://test] INFO route1 - test1 22:03:02.308 [Camel (camel-1) thread #2 - scheduler://test] INFO route2 - test2
Latest documentation claims that only one scheduler/scheduler-thread will be used:
scheduler:name[?options]
Where name is the name of the scheduler, which is created and shared across endpoints. So if you use the same name for all your scheduler endpoints, only one scheduler thread pool and thread will be used...
Am I missing something?