You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mnl <mn...@gmail.com> on 2016/03/03 07:44:01 UTC

Using apache camel failover loadbalancer

I am new to camel and trying to use failover loadbalancer. I have list of
endpoints (say, A, B, C) which can be used to send message such that if one
fails the endpoint next in the list can be tried. lets say B was success.
After successful send, B will receive an exchange which can be used to know
the status of the message sent earlier.
I have tried various versions for loadbalancer as:

Case-1

from(fromEndpoint)
.errorHandler(defaultErrorHandler)
.loadbalance().failover()
.to(smppEndpointList)
.process(getSendProcessor);

> This fails to use the processor returned by the getSendProcessor() and
> overall the flow fails.

Now I change the above version to this.

Case-2 

from(fromEndpoint)
.errorHandler(defaultErrorHandler)
.to(smppEndpointList)
.process(getSendProcessor)
.loadbalance().failover();

> Here if the smppEndpointList has only one endpoint then the call is
> successful but in case of multiple endpints in the list it fails. Also
> from further debugging I found that the processor returned by
> getSendProcessor is not used over here

Case-3

from(fromEndpoint)
.errorHandler(defaultErrorHandler)
.process(getSendProcessor)
.loadbalance().failover()
.to(smppEndpointList);

> This also fails as the processor returned by getSendProcessor is not used.

Can some one please suggest the correct implementation. I am stuck over this
for long.
Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Using-apache-camel-failover-loadbalancer-tp5778537.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using apache camel failover loadbalancer

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

Study the examples here
http://camel.apache.org/load-balancer.html

On Thu, Mar 3, 2016 at 7:44 AM, mnl <mn...@gmail.com> wrote:
> I am new to camel and trying to use failover loadbalancer. I have list of
> endpoints (say, A, B, C) which can be used to send message such that if one
> fails the endpoint next in the list can be tried. lets say B was success.
> After successful send, B will receive an exchange which can be used to know
> the status of the message sent earlier.
> I have tried various versions for loadbalancer as:
>
> Case-1
>
> from(fromEndpoint)
> .errorHandler(defaultErrorHandler)
> .loadbalance().failover()
> .to(smppEndpointList)
> .process(getSendProcessor);
>
>> This fails to use the processor returned by the getSendProcessor() and
>> overall the flow fails.
>
> Now I change the above version to this.
>
> Case-2
>
> from(fromEndpoint)
> .errorHandler(defaultErrorHandler)
> .to(smppEndpointList)
> .process(getSendProcessor)
> .loadbalance().failover();
>
>> Here if the smppEndpointList has only one endpoint then the call is
>> successful but in case of multiple endpints in the list it fails. Also
>> from further debugging I found that the processor returned by
>> getSendProcessor is not used over here
>
> Case-3
>
> from(fromEndpoint)
> .errorHandler(defaultErrorHandler)
> .process(getSendProcessor)
> .loadbalance().failover()
> .to(smppEndpointList);
>
>> This also fails as the processor returned by getSendProcessor is not used.
>
> Can some one please suggest the correct implementation. I am stuck over this
> for long.
> Thanks
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-apache-camel-failover-loadbalancer-tp5778537.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2