Quantcast

Load Balancing

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Load Balancing

Rocco Gallo Citera
Hello, sorry to bother but I have a problem understanding how load
balancing works with some endpoints.
Basically, I have the following route in a client:
from(timer endpoint)
.loadbalance().roundrobin() (with other types of load balancing the
problem is similar)
.to(http endpoint 1, http endpoint 2)
.end;

from(http endpoint) // both endpoints have the same behavior
.to(file endpoint)

In the server, I have
from(jetty endpoint).
.process(my process)
.to(hazelcast endpoint)

If I don't use the load balance, the example works great, but with it,
any onException are not caught (I can see them on a logging console).
If I use a TCPMon in between the client and the server, I see a
continuous flow with a connection switch every time the starting timer
triggers, but I expected the timer to start the exchange and write now
it just switch connection, so I don't understand why. I tried to find
any documentation about that but none was found. Can anyone please
help me to understand why this behavior happens? I'm using Camel
2.9.2.

Thank you very much.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Load Balancing

Claus Ibsen-2
Hi

I am not sure people can follow what your problem is?

If you want error handling then read about Camel error handling, and
the links from this page
http://camel.apache.org/error-handling-in-camel.html

And there is also a failover load balancer
http://camel.apache.org/load-balancer.html

See if those links help you a bit.
And then come back later if you still have some questions.


On Thu, May 10, 2012 at 5:09 PM, Rocco Gallo Citera
<[hidden email]> wrote:

> Hello, sorry to bother but I have a problem understanding how load
> balancing works with some endpoints.
> Basically, I have the following route in a client:
> from(timer endpoint)
> .loadbalance().roundrobin() (with other types of load balancing the
> problem is similar)
> .to(http endpoint 1, http endpoint 2)
> .end;
>
> from(http endpoint) // both endpoints have the same behavior
> .to(file endpoint)
>
> In the server, I have
> from(jetty endpoint).
> .process(my process)
> .to(hazelcast endpoint)
>
> If I don't use the load balance, the example works great, but with it,
> any onException are not caught (I can see them on a logging console).
> If I use a TCPMon in between the client and the server, I see a
> continuous flow with a connection switch every time the starting timer
> triggers, but I expected the timer to start the exchange and write now
> it just switch connection, so I don't understand why. I tried to find
> any documentation about that but none was found. Can anyone please
> help me to understand why this behavior happens? I'm using Camel
> 2.9.2.
>
> Thank you very much.



--
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Load Balancing

Rocco Gallo Citera
Thank you Claus, I read both before sending the mail.
I will try to explain myself better.
I do not understand why, with load balancing between two HTTP nodes,
if I have a client route starting with a timer with certain
configuration, the client makes "independent" continuous requests
switching connections instead of start request only when the timer
says so. Is this a Camel thing or what do I have to configure for the
route? Why this happens? In the server I have a route that consumes
messages, that why I need to consume message at intervals and not
continuously.

Do I make myself clear or I'm still fuzzy??



On Fri, May 11, 2012 at 1:14 AM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> I am not sure people can follow what your problem is?
>
> If you want error handling then read about Camel error handling, and
> the links from this page
> http://camel.apache.org/error-handling-in-camel.html
>
> And there is also a failover load balancer
> http://camel.apache.org/load-balancer.html
>
> See if those links help you a bit.
> And then come back later if you still have some questions.
>
>
> On Thu, May 10, 2012 at 5:09 PM, Rocco Gallo Citera
> <[hidden email]> wrote:
>> Hello, sorry to bother but I have a problem understanding how load
>> balancing works with some endpoints.
>> Basically, I have the following route in a client:
>> from(timer endpoint)
>> .loadbalance().roundrobin() (with other types of load balancing the
>> problem is similar)
>> .to(http endpoint 1, http endpoint 2)
>> .end;
>>
>> from(http endpoint) // both endpoints have the same behavior
>> .to(file endpoint)
>>
>> In the server, I have
>> from(jetty endpoint).
>> .process(my process)
>> .to(hazelcast endpoint)
>>
>> If I don't use the load balance, the example works great, but with it,
>> any onException are not caught (I can see them on a logging console).
>> If I use a TCPMon in between the client and the server, I see a
>> continuous flow with a connection switch every time the starting timer
>> triggers, but I expected the timer to start the exchange and write now
>> it just switch connection, so I don't understand why. I tried to find
>> any documentation about that but none was found. Can anyone please
>> help me to understand why this behavior happens? I'm using Camel
>> 2.9.2.
>>
>> Thank you very much.
>
>
>
> --
> Claus Ibsen
> -----------------
> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
> FuseSource
> Email: [hidden email]
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Load Balancing

Claus Ibsen-2
On Fri, May 11, 2012 at 6:05 PM, Rocco Gallo Citera
<[hidden email]> wrote:

> Thank you Claus, I read both before sending the mail.
> I will try to explain myself better.
> I do not understand why, with load balancing between two HTTP nodes,
> if I have a client route starting with a timer with certain
> configuration, the client makes "independent" continuous requests
> switching connections instead of start request only when the timer
> says so. Is this a Camel thing or what do I have to configure for the
> route? Why this happens? In the server I have a route that consumes
> messages, that why I need to consume message at intervals and not
> continuously.
>
> Do I make myself clear or I'm still fuzzy??
>

No what do you mean by timer switching connections and what not?



>
>
> On Fri, May 11, 2012 at 1:14 AM, Claus Ibsen <[hidden email]> wrote:
>> Hi
>>
>> I am not sure people can follow what your problem is?
>>
>> If you want error handling then read about Camel error handling, and
>> the links from this page
>> http://camel.apache.org/error-handling-in-camel.html
>>
>> And there is also a failover load balancer
>> http://camel.apache.org/load-balancer.html
>>
>> See if those links help you a bit.
>> And then come back later if you still have some questions.
>>
>>
>> On Thu, May 10, 2012 at 5:09 PM, Rocco Gallo Citera
>> <[hidden email]> wrote:
>>> Hello, sorry to bother but I have a problem understanding how load
>>> balancing works with some endpoints.
>>> Basically, I have the following route in a client:
>>> from(timer endpoint)
>>> .loadbalance().roundrobin() (with other types of load balancing the
>>> problem is similar)
>>> .to(http endpoint 1, http endpoint 2)
>>> .end;
>>>
>>> from(http endpoint) // both endpoints have the same behavior
>>> .to(file endpoint)
>>>
>>> In the server, I have
>>> from(jetty endpoint).
>>> .process(my process)
>>> .to(hazelcast endpoint)
>>>
>>> If I don't use the load balance, the example works great, but with it,
>>> any onException are not caught (I can see them on a logging console).
>>> If I use a TCPMon in between the client and the server, I see a
>>> continuous flow with a connection switch every time the starting timer
>>> triggers, but I expected the timer to start the exchange and write now
>>> it just switch connection, so I don't understand why. I tried to find
>>> any documentation about that but none was found. Can anyone please
>>> help me to understand why this behavior happens? I'm using Camel
>>> 2.9.2.
>>>
>>> Thank you very much.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
>> FuseSource
>> Email: [hidden email]
>> Web: http://fusesource.com
>> Twitter: davsclaus, fusenews
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/



--
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Load Balancing

Rocco Gallo Citera
I did the following:
I define a client with a timer triggering every 10 ms and a HTTP
endpoint, then I wrote a server with a Jetty enpoint and a Hazelcast
endpoint to get items from a queue full of items, and started a client
and two servers adding a load balancing in the client.
Instead of getting one item from the queue every 10 ms (as I thought),
I get a bunch of items (all items I can get in 10 ms of continuous
poll to the queue) but every 10 ms the server I´m hitting changes. I
don´t understand why this happens.


On Sat, May 12, 2012 at 5:20 AM, Claus Ibsen <[hidden email]> wrote:

> On Fri, May 11, 2012 at 6:05 PM, Rocco Gallo Citera
> <[hidden email]> wrote:
>> Thank you Claus, I read both before sending the mail.
>> I will try to explain myself better.
>> I do not understand why, with load balancing between two HTTP nodes,
>> if I have a client route starting with a timer with certain
>> configuration, the client makes "independent" continuous requests
>> switching connections instead of start request only when the timer
>> says so. Is this a Camel thing or what do I have to configure for the
>> route? Why this happens? In the server I have a route that consumes
>> messages, that why I need to consume message at intervals and not
>> continuously.
>>
>> Do I make myself clear or I'm still fuzzy??
>>
>
> No what do you mean by timer switching connections and what not?
>
>
>
>>
>>
>> On Fri, May 11, 2012 at 1:14 AM, Claus Ibsen <[hidden email]> wrote:
>>> Hi
>>>
>>> I am not sure people can follow what your problem is?
>>>
>>> If you want error handling then read about Camel error handling, and
>>> the links from this page
>>> http://camel.apache.org/error-handling-in-camel.html
>>>
>>> And there is also a failover load balancer
>>> http://camel.apache.org/load-balancer.html
>>>
>>> See if those links help you a bit.
>>> And then come back later if you still have some questions.
>>>
>>>
>>> On Thu, May 10, 2012 at 5:09 PM, Rocco Gallo Citera
>>> <[hidden email]> wrote:
>>>> Hello, sorry to bother but I have a problem understanding how load
>>>> balancing works with some endpoints.
>>>> Basically, I have the following route in a client:
>>>> from(timer endpoint)
>>>> .loadbalance().roundrobin() (with other types of load balancing the
>>>> problem is similar)
>>>> .to(http endpoint 1, http endpoint 2)
>>>> .end;
>>>>
>>>> from(http endpoint) // both endpoints have the same behavior
>>>> .to(file endpoint)
>>>>
>>>> In the server, I have
>>>> from(jetty endpoint).
>>>> .process(my process)
>>>> .to(hazelcast endpoint)
>>>>
>>>> If I don't use the load balance, the example works great, but with it,
>>>> any onException are not caught (I can see them on a logging console).
>>>> If I use a TCPMon in between the client and the server, I see a
>>>> continuous flow with a connection switch every time the starting timer
>>>> triggers, but I expected the timer to start the exchange and write now
>>>> it just switch connection, so I don't understand why. I tried to find
>>>> any documentation about that but none was found. Can anyone please
>>>> help me to understand why this behavior happens? I'm using Camel
>>>> 2.9.2.
>>>>
>>>> Thank you very much.
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
>>> FuseSource
>>> Email: [hidden email]
>>> Web: http://fusesource.com
>>> Twitter: davsclaus, fusenews
>>> Blog: http://davsclaus.blogspot.com/
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>
>
>
> --
> Claus Ibsen
> -----------------
> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
> FuseSource
> Email: [hidden email]
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
Loading...