On Wed, Oct 10, 2012 at 10:22 PM, alerios <aleriospreside...@gmail.com> wrote: > Hi Guru, thanks for your reply. > > > I think using the failover load balancer is not an option for me, since my > Bean will not throw an exception when it fails. I want to disable the > Endpoint when I want, based on health checks, for example. Also, I would > like to use the weigthed loadbalancer instead, maybe I would have to > implement my own LoadBalancer class, but then I don't see any value in using > Camel at all for my escenario. > > I tested the JMX console to stop an endpoint processor, but it happens the > same as when removing the Endpoint from the Registry: > > Caused by: java.lang.IllegalStateException: SendProcessor has not been > started: sendTo(Endpoint[bean://tmi3?method=sendResponse]) > > I guess camel is not designed to remove endpoints at runtime. Maybe I should > try removing, and adding the route again, but I'm afraid that could cause a > race condition because of many threads trying to do the same. >
The API on CamelContext to remove endpoints is for the endpoints in its cached registry. The running routes that may use these endpoints will continue to be run as is. Instead you would need to use a custom load balancer, and do you own logic to identify which "processors" to use in the load balancer. If you extend from the base/support classes then there is a chooseProcessor method you can implement which picks the processor to use. In there you can skip processors that are not healthy. > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Removing-an-Endpoint-from-a-route-tp5720818p5720862.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen