camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Removing an Endpoint from a route
Date Sat, 13 Oct 2012 08:43:16 GMT
On Wed, Oct 10, 2012 at 10:22 PM, alerios <> 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:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
FuseSource is now part of Red Hat
Twitter: davsclaus
Author of Camel in Action:

View raw message