You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Minh Tran <da...@gmail.com> on 2014/06/30 08:24:15 UTC

loadbalancing dynamic failover

Hi

I'd like to have a failover route where the list of failover routes are dynamic. My intention is to store this list in a database and be able to control the list of fail overs at runtime.

<from uri="direct:start"/>
<loadBalance>
	<failover/>
	
	<!-- not sure what goes here? -->
</loadBalance>

According to this http://mail-archives.apache.org/mod_mbox/camel-users/201202.mbox/%3CCAGB5yNmsDF2CnpDbR1Yu2bQskhvGwcy1ujkDJOAU21uneK7mJQ@mail.gmail.com%3E

I should use a dynamic router but I don't see how this would work. How do I detect failed/successful routes so I know when to stop the dynamic router? Thanks

Minh

Re: loadbalancing dynamic failover

Posted by Minh Tran <da...@gmail.com>.
This is an interesting solution but unsure how to build it into my routes. Each of my failover route would have to create the same znode and then only one will trigger? I think this is how the zookeeper route policy works but it seems like it's really only useful when you have multiple instances of camel running the same route. 


On 01/07/2014, at 2:30 AM, Scott Stults <ss...@opensourceconnections.com> wrote:

> Another way you could do this is with Zookeeper leader election. Zk itself
> keeps track of the potential backup servers and each candidate must
> maintain an active connection to zk in order to remain a candidate. New
> candidate backups can register at any time.
> 
> Hope that helps give you some options!
> -Scott
> 
> 
> On Mon, Jun 30, 2014 at 2:24 AM, Minh Tran <da...@gmail.com> wrote:
> 
>> Hi
>> 
>> I'd like to have a failover route where the list of failover routes are
>> dynamic. My intention is to store this list in a database and be able to
>> control the list of fail overs at runtime.
>> 
>> <from uri="direct:start"/>
>> <loadBalance>
>>        <failover/>
>> 
>>        <!-- not sure what goes here? -->
>> </loadBalance>
>> 
>> According to this
>> http://mail-archives.apache.org/mod_mbox/camel-users/201202.mbox/%3CCAGB5yNmsDF2CnpDbR1Yu2bQskhvGwcy1ujkDJOAU21uneK7mJQ@mail.gmail.com%3E
>> 
>> I should use a dynamic router but I don't see how this would work. How do
>> I detect failed/successful routes so I know when to stop the dynamic
>> router? Thanks
>> 
>> Minh
> 
> 
> 
> 
> -- 
> Scott Stults | Founder & Solutions Architect | OpenSource Connections, LLC
> | 434.409.2780
> http://www.opensourceconnections.com


Re: loadbalancing dynamic failover

Posted by Scott Stults <ss...@opensourceconnections.com>.
Another way you could do this is with Zookeeper leader election. Zk itself
keeps track of the potential backup servers and each candidate must
maintain an active connection to zk in order to remain a candidate. New
candidate backups can register at any time.

Hope that helps give you some options!
-Scott


On Mon, Jun 30, 2014 at 2:24 AM, Minh Tran <da...@gmail.com> wrote:

> Hi
>
> I'd like to have a failover route where the list of failover routes are
> dynamic. My intention is to store this list in a database and be able to
> control the list of fail overs at runtime.
>
> <from uri="direct:start"/>
> <loadBalance>
>         <failover/>
>
>         <!-- not sure what goes here? -->
> </loadBalance>
>
> According to this
> http://mail-archives.apache.org/mod_mbox/camel-users/201202.mbox/%3CCAGB5yNmsDF2CnpDbR1Yu2bQskhvGwcy1ujkDJOAU21uneK7mJQ@mail.gmail.com%3E
>
> I should use a dynamic router but I don't see how this would work. How do
> I detect failed/successful routes so I know when to stop the dynamic
> router? Thanks
>
> Minh




-- 
Scott Stults | Founder & Solutions Architect | OpenSource Connections, LLC
| 434.409.2780
http://www.opensourceconnections.com

Re: loadbalancing dynamic failover

Posted by Minh Tran <da...@gmail.com>.
I guess in my custom load balancer I can lookup the database to see whether a certain route is currently enabled/disabled. That could work. The only downside would be is that I need to know the full list of routes when Camel starts. That is probably a good enough compromise. Thanks a lot!

On 01/07/2014, at 4:11 AM, Claus Ibsen <cl...@gmail.com> wrote:

> Hi
> 
> This is not supported. The list of endpoints is static. You can write
> your own custom load balancer though.
> 
> 
> On Mon, Jun 30, 2014 at 8:24 AM, Minh Tran <da...@gmail.com> wrote:
>> Hi
>> 
>> I'd like to have a failover route where the list of failover routes are dynamic. My intention is to store this list in a database and be able to control the list of fail overs at runtime.
>> 
>> <from uri="direct:start"/>
>> <loadBalance>
>>        <failover/>
>> 
>>        <!-- not sure what goes here? -->
>> </loadBalance>
>> 
>> According to this http://mail-archives.apache.org/mod_mbox/camel-users/201202.mbox/%3CCAGB5yNmsDF2CnpDbR1Yu2bQskhvGwcy1ujkDJOAU21uneK7mJQ@mail.gmail.com%3E
>> 
>> I should use a dynamic router but I don't see how this would work. How do I detect failed/successful routes so I know when to stop the dynamic router? Thanks
>> 
>> Minh
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/


Re: loadbalancing dynamic failover

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

This is not supported. The list of endpoints is static. You can write
your own custom load balancer though.


On Mon, Jun 30, 2014 at 8:24 AM, Minh Tran <da...@gmail.com> wrote:
> Hi
>
> I'd like to have a failover route where the list of failover routes are dynamic. My intention is to store this list in a database and be able to control the list of fail overs at runtime.
>
> <from uri="direct:start"/>
> <loadBalance>
>         <failover/>
>
>         <!-- not sure what goes here? -->
> </loadBalance>
>
> According to this http://mail-archives.apache.org/mod_mbox/camel-users/201202.mbox/%3CCAGB5yNmsDF2CnpDbR1Yu2bQskhvGwcy1ujkDJOAU21uneK7mJQ@mail.gmail.com%3E
>
> I should use a dynamic router but I don't see how this would work. How do I detect failed/successful routes so I know when to stop the dynamic router? Thanks
>
> Minh



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/