performInvocation allows you to use the resource file to match http method type (GET POST PUT DELETE) to a method in the resource file. However, it wipes out the Exchange headers and body, and the return value is set to the Exchange.In body, except when null is returned. There doesn't seem to be a way to access the exchange, In or Out, headers or body, get or set, inside the resource method. One does have access to @PathParam or @QueryParam that appear in the method signature params which could then be set in the body, are returned to the route, passed in the Exchange. The method can call a service and return values to the calling route in the inBody.
Alternatively, one can direct the cxfrs routes according to http method by using recipient list as in .recipientList(simple("direct:${header.CamelHttpMethod}")); In either case, one could then use the same target url ( as in http://mycompany.com/callrestservice?myparam=12 and the route finds the service restfully according to the http method. With the recipientList trick, the routes are set up with endpoints start direct:GET direct:POST direct:PUT direct:DELETE With peformInvocation, each resource method can call an appropriate service. Furthermore, two identical url requests distinguished only by use of pathParam vs. queryParam or even the name of the param, can be routed, with a further refinement of recipientList trick or if statement in resource method, or .choice( in route. This routing style is actually built in to the rest dsl as in rest(url).get etc. It is difficult to find debate over cxfrs vs rest dsl (avail only since Fall 2015) -- View this message in context: http://camel.465427.n5.nabble.com/Multiple-consumers-for-the-same-endpoint-is-not-allowed-cxfrs-vs-rest-dsl-tp5777492p5777554.html Sent from the Camel - Users mailing list archive at Nabble.com.