Package org.apache.camel.processor.loadbalancer

Examples of org.apache.camel.processor.loadbalancer.WeightedRandomLoadBalancer


            for (String ratio : ratios) {
                distributionRatioList.add(new Integer(ratio.trim()));
            }
           
            if (!isRoundRobin()) {
                loadBalancer = new WeightedRandomLoadBalancer(distributionRatioList);
            } else {
                loadBalancer = new WeightedRoundRobinLoadBalancer(distributionRatioList);
            }
        } catch (Exception e) {
            throw ObjectHelper.wrapRuntimeCamelException(e);
View Full Code Here


        for (String ratio : ratios) {
            distributionRatioList.add(new Integer(ratio.trim()));
        }
       
        if (!roundRobin) {
            weighted = new WeightedRandomLoadBalancer(distributionRatioList);
        } else {
            weighted = new WeightedRoundRobinLoadBalancer(distributionRatioList);
        }
        setLoadBalancerType(new LoadBalancerDefinition(weighted));
        return this;
View Full Code Here

    protected LoadBalancer createLoadBalancer(RouteContext routeContext) {
        WeightedLoadBalancer loadBalancer = null;
       
        try {
            if (!roundRobin) {
                loadBalancer = new WeightedRandomLoadBalancer(distributionRatioList);
            } else {
                loadBalancer = new WeightedRoundRobinLoadBalancer(distributionRatioList);
            }
        } catch (Exception e) {
           
View Full Code Here

     * @return the builder
     */
    public LoadBalanceDefinition weighted(boolean roundRobin, ArrayList<Integer> distributionRatioList) {
        WeightedLoadBalancer weighted;
        if (!roundRobin) {
            weighted = new WeightedRandomLoadBalancer(distributionRatioList);
        } else {
            weighted = new WeightedRoundRobinLoadBalancer(distributionRatioList);
        }
        loadBalancerType = new LoadBalancerDefinition(weighted);
        return this;
View Full Code Here

TOP

Related Classes of org.apache.camel.processor.loadbalancer.WeightedRandomLoadBalancer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.