You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Dávið Klein Sundsskarð <ds...@amc.dk> on 2014/10/20 12:27:17 UTC

REST DSL setup - Failed because of multiple consumers

I am trying to create a REST API but am struggling a bit to get it to behave as I expect it to. I'm using Camel 2.14.

When creating a route with two methods on the same endpoint I get "Failed to start route route2 because of Multiple consumers for the same endpoint is not allowed"

I've tried the example from http://camel.apache.org/rest-dsl.html and even that fails:
rest("/say")
                .get("/hello").to("direct:hello")
                .get("/bye").consumes("application/json").to("direct:bye")
                .post("/bye").to("mock:update");

"Failed to start route route3 because of Multiple consumers for the same endpoint is not allowed: Endpoint[https://localhost:443/say/bye]"

I would expect that when having for example a "/customers" endpoint I could GET that to get a list and POST to create a customer. (rest("customer").get().to("direct:get").post().to("direct:create"))

Am I missing something?

Thanks,
David



Re: REST DSL setup - Failed because of multiple consumers

Posted by David S <ds...@amc.dk>.
Great, It is working when using 2.14.1-SNAPSHOT.

Thanks :-)



--
View this message in context: http://camel.465427.n5.nabble.com/REST-DSL-setup-Failed-because-of-multiple-consumers-tp5757805p5757849.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: REST DSL setup - Failed because of multiple consumers

Posted by Willem Jiang <wi...@gmail.com>.
It’s a known issue[1].
Can you try the latest Camel 2.14.1-SNAPSHOT? 
It should have the fix of this issue.

[1]https://issues.apache.org/jira/browse/CAMEL-7899

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 20, 2014 at 6:27:49 PM, Dávið Klein Sundsskarð (ds@amc.dk) wrote:
> I am trying to create a REST API but am struggling a bit to get it to behave as I expect it to.  
> I'm using Camel 2.14.
>  
> When creating a route with two methods on the same endpoint I get "Failed to start route  
> route2 because of Multiple consumers for the same endpoint is not allowed"
>  
> I've tried the example from http://camel.apache.org/rest-dsl.html and even that  
> fails:
> rest("/say")
> .get("/hello").to("direct:hello")
> .get("/bye").consumes("application/json").to("direct:bye")
> .post("/bye").to("mock:update");
>  
> "Failed to start route route3 because of Multiple consumers for the same endpoint is  
> not allowed: Endpoint[https://localhost:443/say/bye]"
>  
> I would expect that when having for example a "/customers" endpoint I could GET that to  
> get a list and POST to create a customer. (rest("customer").get().to("direct:get").post().to("direct:create"))  
>  
> Am I missing something?
>  
> Thanks,
> David
>  
>  
>