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

Removing route stops other routes from the same producer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.11.0
    • 2.11.1, 2.12.0
    • camel-core
    • None
    • Unknown

    Description

      If there are 2 routes from the same source, e.g.:

      CamelContext camelContext = new DefaultCamelContext();
      final PrinterBean bean1 = new PrinterBean("bean1");
      final PrinterBean bean2 = new PrinterBean("bean2");
      RouteBuilder builder = new RouteBuilder(camelContext) {
          @Override
          public void configure() throws Exception {
              from("vm:producer?multipleConsumers=true").routeId("route1").bean(bean1);
          }
      
      };
      RouteBuilder builder2 = new RouteBuilder(camelContext) {
          @Override
          public void configure() throws Exception {
              from("vm:producer?multipleConsumers=true").routeId("route2").bean(bean2);
          }
      };
      camelContext.addRoutes(builder);
      camelContext.addRoutes(builder2);
      

      And if after starting the context camelContext.start(); I stop and remove one of the routes the other one will stop working as well.

      camelContext.stopRoute("route2");
      camelContext.removeRoute("route2");
      

      These messages will not be delivered to bean1:

      System.out.println("Sending message");
      ProducerTemplate producerTemplate = camelContext.createProducerTemplate();
      for (int i = 0; i < 100; i++) {
          producerTemplate.sendBody("vm:producer?multipleConsumers=true", i);
      }
      

      When debugging I noticed that in SedaEndpoint on line 144 it stops shared MulticastProcessor used by the both routes.

      Please see this post to get the entire source file:
      http://camel.465427.n5.nabble.com/Removing-route-stops-other-routes-from-the-same-producer-td5732616.html

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              ikoblik Ivan Koblik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: