Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Adding Routes at the runtime-cannot add multiple consumer to the same endpoint

$
0
0
Hi,
We have a requirement where in we have to add the routes at the runtime to
camel-context which is already running.

The following piece of code works for the first time, but when i execute it
for the second time it causing mulitple consumer error.

code:
public void addroutestocontext(CamelContext camelContext){
String Rqendpoint=direct:test1;
String Rsendpoint=direct:test2;
MessageRouter router=new MessageRouter();
router.setRqendpoint(Rqendpoint);
router.setRsendpoint(Rsendpoint);
*camelContext.addRoutes(router);*

producer.asyncRequestBodyAndHeaders(,Rqendpointbody, headers);

.......
.....

Issue:Cannot add a 2nd consumer to the same endpoint. Endpoint
Endpoint[direct://test1] only allows one consumer

Please provide me a solution.
Thanks a lot.

Viewing all articles
Browse latest Browse all 5648

Trending Articles