You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Pierre-Alban DEWITTE (JIRA)" <ji...@apache.org> on 2014/10/23 22:00:36 UTC

[jira] [Created] (CAMEL-7952) Camel REST does not handle same path with differents VERBS

Pierre-Alban DEWITTE created CAMEL-7952:
-------------------------------------------

             Summary: Camel REST does not handle same path with differents VERBS
                 Key: CAMEL-7952
                 URL: https://issues.apache.org/jira/browse/CAMEL-7952
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.14.0
         Environment: ALL
            Reporter: Pierre-Alban DEWITTE


If we had the same path with different verbs (GET, POST, DELETE) only one is randomly choosen.

To reproduce this issue i just changed the route builder in camel-example-servlet-rest-tomcat.

In UserRouteBuilder.java change the last statement  of configure() method  with :

        rest("/user").description("User rest service")
            .consumes("application/json").produces("application/json")
            .get("/name").description("GET").outTypeList(User.class)
                .to("bean:userService?method=listUsers")
            .post("/name").description("POST").to("bean:userService?method=listUsers")
            .delete("/{name}").description("DELETE").to("bean:userService?method=listUsers")
                ;

After a quick debug it seams that the CamelServlet is fiiling a map of HttpConsumer. The key is path so only last one can be used further.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)