Cool. The implementation is also simpler if we go with the 2nd approach :) I'll send in a patch.
Thanks Azeez On Fri, Aug 15, 2008 at 2:53 PM, Ruwan Linton <[EMAIL PROTECTED]>wrote: > +1 for the option 2 > > Thanks, > Ruwan > > > On Fri, Aug 15, 2008 at 12:16 PM, Asankha C. Perera <[EMAIL PROTECTED]>wrote: > >> Hi Azeez >> >> 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> >> >> We haven't yet used the synapse.xml to "define" non mediation aspects of >> Synapse. We already do have a synapse.properties, which defines datasources >> for use by the synapse.xml's DB mediators. So I think we should not do this >> in synapse.xml, but the properties file would be good.. >> >> *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. >> >> I think this approach is slightly better, since its all in "one file".. >> and anyway you are just defining the algorithm impl class name as a String >> >> So between the two, I personally prefer option #2 >> >> asankha >> -- >> Asankha C. Perera >> >> WSO2 - http://wso2.org >> http://esbmagic.blogspot.com >> >> > > > -- > Ruwan Linton > http://wso2.org - "Oxygenating the Web Services Platform" > http://ruwansblog.blogspot.com/ > -- Thanks Afkham Azeez http://afkham.org http://www.wso2.org GPG Fingerprint: 643F C2AF EB78 F886 40C9 B2A2 4AE2 C887 665E 0760
