Hi folks,

At present, u cannot introduce a new LB algorithm impl without code changes.
Only round-robin load balancing is supported, and the implementation has
been somewhat hard-coded to use round-robin load balancing. Users cannot do
a config change and incorporate a new algorithm. Ideally, we should let them
specify the algorithm impl in the synapse.xml file. There are two way this
may be done.

*1.*

<definitions xmlns="http://ws.apache.org/ns/synapse";>

  *<loadbalanceAlgorithms>**
*
*  <algorithm name="ec2-autoscale-roundrobin"**
**  implementation="org.apache.synapse.algorithms.Ec2AutoScaleRoundRobin"/>*
*
**  </loadbalanceAlgorithms>*

<endpoint name="dynamicLB">
  <dynamicLoadbalance failover="true" policy="*ec2-autoscale-roundrobin*">
  <membershipHandler
  class="org.apache.synapse.core.axis2.Axis2LoadBalanceMembershipHandler">
  <property name="applicationDomain" value="apache.axis2.app.domain"/>
  </membershipHandler>
  </dynamicLoadbalance>

  </endpoint>

</definitions>

*2.*

<definitions xmlns="http://ws.apache.org/ns/synapse";>

<endpoint name="dynamicLB">
  <dynamicLoadbalance failover="true" *
algorithm="org.apache.synapse.algorithms.Ec2AutoScaleRoundRobin"*>
  <membershipHandler
  class="org.apache.synapse.core.axis2.Axis2LoadBalanceMembershipHandler">
  <property name="applicationDomain" value="apache.axis2.app.domain"/>
  </membershipHandler>
  </dynamicLoadbalance>

  </endpoint>

</definitions>

Both approaches preserve backwards compatibility. Please send in your
suggestions.
-- 
Thanks
Afkham Azeez

http://afkham.org
http://www.wso2.org
GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760

Reply via email to