143144145146147148149150
* * @param loadBalancer the load balancer * @return the builder */ public LoadBalanceDefinition setLoadBalancer(LoadBalancer loadBalancer) { loadBalancerType = new LoadBalancerDefinition(loadBalancer); return this; }
153154155156157158159160
* Uses fail over load balancer * * @return the builder */ public LoadBalanceDefinition failOver() { loadBalancerType = new LoadBalancerDefinition(new FailOverLoadBalancer()); return this; }
164165166167168169170171
* * @param throwable exception Class which we want to catch * @return the builder */ public LoadBalanceDefinition failOver(Class throwable) { loadBalancerType = new LoadBalancerDefinition(new FailOverLoadBalancer(throwable)); return this; }
174175176177178179180181
* Uses round robin load balancer * * @return the builder */ public LoadBalanceDefinition roundRobin() { loadBalancerType = new LoadBalancerDefinition(new RoundRobinLoadBalancer()); return this; }
183184185186187188189190
/** * Uses random load balancer * @return the builder */ public LoadBalanceDefinition random() { loadBalancerType = new LoadBalancerDefinition(new RandomLoadBalancer()); return this; }
194195196197198199200201
* * @param correlationExpression the expression for correlation * @return the builder */ public LoadBalanceDefinition sticky(Expression correlationExpression) { loadBalancerType = new LoadBalancerDefinition(new StickyLoadBalancer(correlationExpression)); return this; }
204205206207208209210211
* Uses topic load balancer * * @return the builder */ public LoadBalanceDefinition topic() { loadBalancerType = new LoadBalancerDefinition(new TopicLoadBalancer()); return this; }