Willem.Jiang wrote:
>
> Hi,
> I don't think Camel support to add and remove the endpoints of the
> LoadBalancer as you want in the runtime.
> But the now camel route can be start and stop in the runtime. maybe you
> can consider to stop the route, change the route and start it again.
>
Can you elaborate on "stop the route, change the route and start it again".
And related question.
The following code
/**************************************/
RouteDefinition route = new RouteDefinition();
route.from("sergey:in")
.process(new Processor() {
public void process(Exchange exchange) throws Exception
{
System.out.println("Received " + exchange.getIn());
}
})
.loadBalance().roundRobin()
.to("jms1:queue:testqueue")
.to("jms1:queue:testqueue2")
.to("jms2:queue:testqueue");
context.addRouteDefinition(route);
context.start();
/***********************************/
gives me exception
Exception in thread "main" org.apache.camel.FailedToCreateRouteException:
Failed to create route route1 at: >>> LoadBalanceType[ref:null, []] <<< in
route: Route[[From[sergey:in]] -> [process[com.sybase365.CamelJmsTe...
because of ref or loadBalancer must be specified
But it works if I do the same using context.addRoutes(new RouteBuilder() {
/* same configuration */ }).
Thanks,
Sergey.
--
View this message in context:
http://camel.465427.n5.nabble.com/LoadBalansing-configuration-tp3315711p3316580.html
Sent from the Camel - Users mailing list archive at Nabble.com.