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

Using "route1" as a route id produces infinite loop

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.24.0
    • 3.0.0-M3, 2.23.3, 2.24.1, 3.0.0, 2.25.0
    • came-core
    • None
    • JDK 8u121

      Camel 2.24.0

    • Unknown

    Description

      Steps:

      1. Start a Camel context.
      2. Add a route through RouteBuilder with id "route1" (reserved id).
      3. Attempt to add a second route with no id. The method enters an infinite loop. 

      Example code that reproduces the problem:

      package com.paytrue.swakka;
      
      import org.apache.camel.builder.RouteBuilder;
      import org.apache.camel.impl.DefaultCamelContext;
      
      public class InfLoopMain {
      
          public static void main(final String[] args) throws Exception {
              final DefaultCamelContext camelContext = new DefaultCamelContext();
              camelContext.start();
      
              final RouteBuilder route1 = new RouteBuilder() {
                  @Override
                  public void configure() {
                      from("direct:in1")
                          .id("route1") // Note the name
                          .to("mock:test1");
                  }
              };
              camelContext.addRoutes(route1);
      
              final RouteBuilder route2 = new RouteBuilder() {
                  @Override
                  public void configure() {
                      from("direct:in2")
                          .to("mock:test2");
                  }
              };
              // Infinite loop
              camelContext.addRoutes(route2);
          }
      }
      

       

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            gsoto Gabriel Soto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: