On Oct 24, 2013 11:49 PM, "Imesh Gunaratne" <[email protected]> wrote: > > Hi Nirmal, > > Thanks for the clarification! As I understood we are discussing about two points: > > 1. Defining Endpoint definition programmatically in service component Vs defining it in Synapse main sequence file: main.xml. There's no argument over this, this was the intention, but no one could find time to do this. > > IMO I would like to see the end point definition in the main.xml due to several reasons: > a) It is easier for people to understand the Synapse sequence used by the load balancer by looking at the main.xml. This not a requirement if you think from a user perspective, who would configure lb. > b) The endpoint could be changed without re-compiling the product. This should be discouraged and never perform on a production system. > c) If the user updates the main.xml file, the load balancer should work without any problems without having to restart.
In reality this would mean a downtime, so again, should not be encouraged. As I noticed it was not the case with the previous version since the main sequence was modified in service component activate() method. > > 2. Using the loadbalancer.conf file for load balancer configuration Vs using Synapse main sequence file: main.xml. > > +1 for using the loadbalancer.conf file. However I do not think we could move each and every configuration to it. Absolutely not, but ideally the stuff you need to configure lb should go there. It's the ultimate goal, we don't need to reach there today. My 10 cents. As an example the current load balancer uses the axis2.xml for defining the HTTP and HTTPS ports and jndi.properties for defining message broker connection details. And I'm sure there are many other configuration files like these. > > What I would like to Propose > I would like to propose to keep the endpoint definition in the main.xml and the other properties in loadbalancer.conf: > > main.xml: > <sequence xmlns="http://ws.apache.org/ns/synapse" name="main" onError="fault"> > ... > <in> > ... > <send> > <endpoint name="tenantAwareLBEndpoint"> > <class name ="org.apache.stratos.lb.endpoint.endpoint.TenantAwareLoadBalanceEndpoint"></class> > </endpoint> > </send> > <drop/> > </in> > ... > > loadbalancer.conf: > 1. Algorithm Class Name > 2. Failover > 3. Session Affinity > 4. Session Timeout > 5. Static Topology (if the PaaS is not used) > 6. Service Clusters to be served. > n. etc > > > Thanks > Imesh > > > On Wed, Oct 23, 2013 at 10:57 AM, Nirmal Fernando <[email protected]> wrote: >> >> >> >> >> On Wed, Oct 23, 2013 at 10:48 AM, Imesh Gunaratne <[email protected]> wrote: >>> >>> Thanks Lakmal! >>> >>> Nirmal: >>> No, still support for multi-tenancy is not implemented. That should come under "Components to be Implemented". Thanks for reminding it. >>> >>> I actually didn't see these were configured from load-balancer.conf in the previous version: >>> Endpoint was hard coded in the service component activate() method: >>> >>> /* add Tenant Aware LB endpoint */ >>> TenantAwareLoadBalanceEndpoint tenantAwareEp = new TenantAwareLoadBalanceEndpoint(); >>> tenantAwareEp.init(synapseEnv); >>> sendMediator.setEndpoint(tenantAwareEp); >>> >>> Algorithm was hard coded in endpoint init() method: >>> >>> LoadbalanceAlgorithm algorithm = null; >>> try { >>> OMElement payload = AXIOMUtil.stringToOM(generatePayLoad()); >>> algorithm = >>> LoadbalanceAlgorithmFactory. >>> createLoadbalanceAlgorithm(payload, null); >>> >>> } >>> ... >>> } >>> >>> private String generatePayLoad() { >>> return " <serviceDynamicLoadbalance failover=\"true\"\n" + >>> " algorithm=\"org.apache.synapse.endpoints.algorithms.RoundRobin\"" + >>> //" configuration=\"$system:loadbalancer.xml\"" + >>> "/>"; >>> } >>> >>> IMO this is not a good programming practice. >> >> >> Yes, initial developers had done it that way, but I remember I patched somethings like Endpoint, but seems like those patches hasn't merged here. >>> >>> >>> I agree that it is easier for the user to configure all load balancer specific parameters via a single configuration file. However when we look at the overall picture, I think it is better to keep Synapse main sequence related configuration in its main.xml file. >> >> >> I tend to disagree. Whole point of introducing the loadbalancer conf file is to make all the things configurable via a single file and to make all configurations dev-ops friendly (eg: you don't need to know Synapse to configure a LB endpoint). >> >> Sorry, but I'm -1 for adding these back to main.xml. >> >> PS: bit of history, these were resided in main.xml and they were moved out from it, cause there were problems. >>> >>> >>> >>> Thanks >>> Imesh >>> >>> >>> >>> >>> >>> >>> On Wed, Oct 23, 2013 at 9:22 AM, Nirmal Fernando <[email protected]> wrote: >>>> >>>> >>>> >>>> >>>> On Wed, Oct 23, 2013 at 9:09 AM, Imesh Gunaratne <[email protected]> wrote: >>>>> >>>>> Hi All, >>>>> >>>>> The load balancer of the new architecture is now functional with its own algorithm interface and round robin implementation. Please find detailed information on the improvements done in this version below: >>>>> >>>>> Improvements: >>>>> - Implemented an algorithm interface and its implementation for Round Robin >>>>> - Moved hard coded values in main sequence to its xml file >>>> >>>> Do you mind elaborating this change? We moved away from xml file to loadbalncer conf file, since it's more dev-ops friendly. So, IMO better to make all the things configurable via loadbalancer.conf file. >>>> >>>> >>>>> - Fixed logic which set the location value in the response header >>>>> - Upgraded synapse version to 2.1.1 wso2v7 >>>>> - Changed default transport to pass-through >>>>> >>>>> I have tested this version with few application server instances and topology synchronization, session management, round robin algorithm, URL handling features worked as expected. >>>>> >>>>> Commit Revision: >>>>> 4a1de9c56f297dde3446838733686330dea21562 >>>>> >>>>> Binary Package: >>>>> http://imesh.gunaratne.org/files/stratos/lb/apache-stratos-lb-4.0.0-IMV2.zip >>>>> >>>>> >>>>> Components to be Implemented: >>>>> Domain mappings >>>>> >>>>> Many Thanks >>>>> Imesh >>>>> >>>> >>>> >>>> >>>> -- >>>> Best Regards, >>>> Nirmal >>>> >>>> Nirmal Fernando. >>>> PPMC Member & Committer of Apache Stratos, >>>> Senior Software Engineer, WSO2 Inc. >>>> >>>> Blog: http://nirmalfdo.blogspot.com/ >>> >>> >> >> >> >> -- >> Best Regards, >> Nirmal >> >> Nirmal Fernando. >> PPMC Member & Committer of Apache Stratos, >> Senior Software Engineer, WSO2 Inc. >> >> Blog: http://nirmalfdo.blogspot.com/ > >
