You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jonathan Vila (JIRA)" <ji...@apache.org> on 2019/06/16 16:24:00 UTC

[jira] [Created] (CAMEL-13651) Rest DSL seems to duplicate the routes, therefore we can experience on having duplicated ids issues

Jonathan Vila created CAMEL-13651:
-------------------------------------

             Summary: Rest DSL seems to duplicate the routes, therefore we can experience on having duplicated ids issues
                 Key: CAMEL-13651
                 URL: https://issues.apache.org/jira/browse/CAMEL-13651
             Project: Camel
          Issue Type: Bug
    Affects Versions: 2.21.0
            Reporter: Jonathan Vila


Having this route :
{code:java}
rest() 
  .post("/upload/{customerID}") 
    .to("direct:upload") 
  .get("/health") 
    .to("log:health") 
  .get("/info") 
    .to("log:info");
{code}

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 :

{code:java}
        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");
{code}
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")*
 





--
This message was sent by Atlassian JIRA
(v7.6.3#76005)