Examples of WeightedLoadBalancer


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

    public WeightedLoadBalancerDefinition() {
    }

    @Override
    protected LoadBalancer createLoadBalancer(RouteContext routeContext) {
        WeightedLoadBalancer loadBalancer;
        List<Integer> distributionRatioList = new ArrayList<Integer>();
       
        try {
            if (distributionRatioDelimiter == null) {
                distributionRatioDelimiter = ",";
View Full Code Here

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

     * @param distributionRatio            String of weighted ratios for distribution of messages.
     * @param distributionRatioDelimiter   String containing delimiter to be used for ratios
     * @return the builder
     */
    public LoadBalanceDefinition weighted(boolean roundRobin, String distributionRatio, String distributionRatioDelimiter) {
        WeightedLoadBalancer weighted;
        List<Integer> distributionRatioList = new ArrayList<Integer>();
       
        String[] ratios = distributionRatio.split(distributionRatioDelimiter);
        for (String ratio : ratios) {
            distributionRatioList.add(new Integer(ratio.trim()));
View Full Code Here

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

    @XmlAttribute(name = "distributionRatio", required = true)
    private List<Integer> distributionRatioList = new ArrayList<Integer>();
   
    @Override
    protected LoadBalancer createLoadBalancer(RouteContext routeContext) {
        WeightedLoadBalancer loadBalancer = null;
       
        try {
            if (!roundRobin) {
                loadBalancer = new WeightedRandomLoadBalancer(distributionRatioList);
            } else {
View Full Code Here

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

     * @param roundRobin               used to set the processor selection algorithm.
     * @param distributionRatioList    ArrayList<Long> of weighted ratios for distribution of messages.
     * @return the builder
     */
    public LoadBalanceDefinition weighted(boolean roundRobin, ArrayList<Integer> distributionRatioList) {
        WeightedLoadBalancer weighted;
        if (!roundRobin) {
            weighted = new WeightedRandomLoadBalancer(distributionRatioList);
        } else {
            weighted = new WeightedRoundRobinLoadBalancer(distributionRatioList);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.