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

Rest DSL seems to duplicate the routes, therefore we can experience on having duplicated ids issues

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Implemented
    • 2.21.0
    • 2.23.0
    • None
    • None
    • Unknown

    Description

      Having this route :

      rest() 
        .post("/upload/{customerID}") 
          .to("direct:upload") 
        .get("/health") 
          .to("log:health") 
        .get("/info") 
          .to("log:info");
      

      When I inspect camelContext.getRoutes() I see route1, route2, route3, post1, get1, get2 and route1 is identical to post1, and so on.

      So , if I try to assign an id to a route :

              rest()
                      .id("rest-route")
                      .get("/health")
                          .id("get-health")
                          .to("log:health")
                      .post("/uploadXX/{customerID}")
                          .id("post-upload")
                          .to("direct:upload")
                      .get("/info")
                          .id("get-info")
                          .to("log:info");
      

      Then I get an error : Failed to start route get-health because of duplicate id detected: get-health

      The motivation to give ids to rest routes is to test only one at a time. I do that using @AdviceWith and then camelContext.startRoute("post1")

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jonvila Jonathan Vila
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: