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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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