You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Hiranya Jayathilaka (JIRA)" <ji...@apache.org> on 2008/12/23 05:29:44 UTC

[jira] Reopened: (SYNAPSE-433) Loadbalance Algorithm is hardcoded

     [ https://issues.apache.org/jira/browse/SYNAPSE-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hiranya Jayathilaka reopened SYNAPSE-433:
-----------------------------------------


I see two problems in the current load balance algorithm factory implementations.

1. round robin algorithm is still hard coded
2. algorithm factory does not read the algorithm implementation from the 'algorithm' attribute in the configuration.

Here is the erroneous method from the source.

public static LoadbalanceAlgorithm createLoadbalanceAlgorithm(OMElement loadbalanceElement, List endpoints) {

        LoadbalanceAlgorithm algorithm = null;

        String algorithmName = "roundRobin";
        OMAttribute algoAttribute = loadbalanceElement.getAttribute(new QName(null, XMLConfigConstants.ALGORITHM_NAME));
        if(algoAttribute != null) {
            algorithmName = algoAttribute.getAttributeValue();
        }

        if(algorithmName.equalsIgnoreCase("roundRobin")) {
                algorithm = new RoundRobin(endpoints);
        }

        return algorithm;
    }

The value of the ALGORITHM_NAME constant is "policy". So the method does not refer the "algorithm" attribute anywhere in the code.

> Loadbalance Algorithm is hardcoded
> ----------------------------------
>
>                 Key: SYNAPSE-433
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-433
>             Project: Synapse
>          Issue Type: Bug
>          Components: Endpoints
>            Reporter: Afkham Azeez
>            Assignee: Ruwan Linton
>            Priority: Critical
>             Fix For: NIGHTLY
>
>         Attachments: lb-algorithm.patch
>
>
> There is no way to switch to a different algorithm other than round-robin without a code change. The load balancing has been hard coded to use round-robin algorithm.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org