Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14442

Scheduler no longer shared between routes using the same scheduler name

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.1
    • Fix Version/s: 3.1.0, 3.0.2
    • Component/s: camel-scheduler
    • Labels:
      None
    • Estimated Complexity:
      Unknown
    • Regression:
      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?

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              pascalschumacher Pascal Schumacher
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: