You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Ning Jiang <wi...@gmail.com> on 2007/11/08 19:59:33 UTC
LoaderBalancer DSL support
Hi,
I just jump into writing some demos which could show how to use camel
as a load balancer.
I can find there are lots of balancer processor in the camel-core module.
But when I went through the code , I just found there is no DSL
balancer type class to handle the load balancer setting up stuff and
no test code to show how to use them in a program way.
Here is my proposal for the LoaderBalancer DSL support.
The DSL could be
form(EndpointA).loaderBalancer("RoundRobin").to("EndpointB").to("EndpointC").to("EndponitD");
or
form(EndpointA).loaderBalancer("Random").addEndpoint("EndpointB").addEndpoint("EndpointC").addEndpoint("EndponitD");
Any thought?
Willem.
Re: LoaderBalancer DSL support
Posted by Ning Jiang <wi...@gmail.com>.
Yep, I think we could support both of them .
Willem.
On Nov 8, 2007 4:15 PM, William Tam <em...@gmail.com> wrote:
> Just to extend your idea ...
>
> We could do something like.
>
> LoadBalancingStrategy myStrategy; // my own strategy to choose an endpoint
>
> from(endpointA).loadBalance(myStrategy).to(Endpoint1, Endpoint2, ...);
>
> or if can use an out of the box strategy like:
>
> from(endpointA).roundRobinLoadBalance().to(endpoint1, endpoint2, ...);
>
>
> On Nov 8, 2007 1:59 PM, Ning Jiang <wi...@gmail.com> wrote:
> > Hi,
> >
> > I just jump into writing some demos which could show how to use camel
> > as a load balancer.
> > I can find there are lots of balancer processor in the camel-core module.
> > But when I went through the code , I just found there is no DSL
> > balancer type class to handle the load balancer setting up stuff and
> > no test code to show how to use them in a program way.
> >
> > Here is my proposal for the LoaderBalancer DSL support.
> > The DSL could be
> > form(EndpointA).loaderBalancer("RoundRobin").to("EndpointB").to("EndpointC").to("EndponitD");
> >
> > or
> >
> > form(EndpointA).loaderBalancer("Random").addEndpoint("EndpointB").addEndpoint("EndpointC").addEndpoint("EndponitD");
> >
> >
> > Any thought?
> >
> > Willem.
> >
>
Re: LoaderBalancer DSL support
Posted by James Strachan <ja...@gmail.com>.
Just a minor twist on that idea; how about
from(endpointA).loadBalance().roundRobin().endpoints().<someExpression>
where loadBalance() returns a LoadBalanceClause rather like filter()
returns an ExpressionClause which lets folks pick the strategy of load
balancer to use.
Using a named reference could be by
from(endpointA).loadBalance().ref("someName")...
I also added the idea of using an expression to determine the
endpoints to load balance across as we might wanna support dynamic
load balancing. e.g. querying the endpoints in OSGi or JNDI or
whatever.
On 08/11/2007, William Tam <em...@gmail.com> wrote:
> Just to extend your idea ...
>
> We could do something like.
>
> LoadBalancingStrategy myStrategy; // my own strategy to choose an endpoint
>
> from(endpointA).loadBalance(myStrategy).to(Endpoint1, Endpoint2, ...);
>
> or if can use an out of the box strategy like:
>
> from(endpointA).roundRobinLoadBalance().to(endpoint1, endpoint2, ...);
>
>
> On Nov 8, 2007 1:59 PM, Ning Jiang <wi...@gmail.com> wrote:
> > Hi,
> >
> > I just jump into writing some demos which could show how to use camel
> > as a load balancer.
> > I can find there are lots of balancer processor in the camel-core module.
> > But when I went through the code , I just found there is no DSL
> > balancer type class to handle the load balancer setting up stuff and
> > no test code to show how to use them in a program way.
> >
> > Here is my proposal for the LoaderBalancer DSL support.
> > The DSL could be
> > form(EndpointA).loaderBalancer("RoundRobin").to("EndpointB").to("EndpointC").to("EndponitD");
> >
> > or
> >
> > form(EndpointA).loaderBalancer("Random").addEndpoint("EndpointB").addEndpoint("EndpointC").addEndpoint("EndponitD");
> >
> >
> > Any thought?
> >
> > Willem.
> >
>
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com
Re: LoaderBalancer DSL support
Posted by William Tam <em...@gmail.com>.
Just to extend your idea ...
We could do something like.
LoadBalancingStrategy myStrategy; // my own strategy to choose an endpoint
from(endpointA).loadBalance(myStrategy).to(Endpoint1, Endpoint2, ...);
or if can use an out of the box strategy like:
from(endpointA).roundRobinLoadBalance().to(endpoint1, endpoint2, ...);
On Nov 8, 2007 1:59 PM, Ning Jiang <wi...@gmail.com> wrote:
> Hi,
>
> I just jump into writing some demos which could show how to use camel
> as a load balancer.
> I can find there are lots of balancer processor in the camel-core module.
> But when I went through the code , I just found there is no DSL
> balancer type class to handle the load balancer setting up stuff and
> no test code to show how to use them in a program way.
>
> Here is my proposal for the LoaderBalancer DSL support.
> The DSL could be
> form(EndpointA).loaderBalancer("RoundRobin").to("EndpointB").to("EndpointC").to("EndponitD");
>
> or
>
> form(EndpointA).loaderBalancer("Random").addEndpoint("EndpointB").addEndpoint("EndpointC").addEndpoint("EndponitD");
>
>
> Any thought?
>
> Willem.
>