Examples of CircuitBreakerLoadBalancerDefinition


Examples of org.apache.camel.model.loadbalancer.CircuitBreakerLoadBalancerDefinition

        RouteDefinition route = assertOneRoute("routeWithCircuitBreakerLoadBalance.xml");
        assertFrom(route, "direct:start");
        LoadBalanceDefinition loadBalance = assertOneProcessorInstanceOf(LoadBalanceDefinition.class, route);
        assertEquals("Should have 1 output", 1, loadBalance.getOutputs().size());
        assertTrue("The loadBalancer should be CircuitBreakerLoadBalancerDefinition", loadBalance.getLoadBalancerType() instanceof CircuitBreakerLoadBalancerDefinition);
        CircuitBreakerLoadBalancerDefinition strategy = (CircuitBreakerLoadBalancerDefinition)loadBalance.getLoadBalancerType();
        assertEquals("Should have 1 exception", 1, strategy.getExceptions().size());
        assertEquals("Should have threshold of 2", 2, strategy.getThreshold().intValue());
        assertEquals("Should have HalfOpenAfter timeout of 1000L ", 1000L, strategy.getHalfOpenAfter().longValue());
    }
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.