Class RoundRobinLoadBalancingStrategy
java.lang.Object
org.springframework.integration.dispatcher.RoundRobinLoadBalancingStrategy
- All Implemented Interfaces:
LoadBalancingStrategy
Round-robin implementation of
LoadBalancingStrategy
. This
implementation will keep track of the index of the handler that has been
tried first and use a different starting handler every dispatch.- Since:
- 1.0.3
- Author:
- Iwein Fuld, Mark Fisher, Oleg Zhurakousky, Artem Bilan
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Iterator<MessageHandler>
getHandlerIterator
(Message<?> message, Collection<MessageHandler> handlers) Returns an iterator that starts at a new point in the collection every time the first part of the list that is skipped will be used at the end of the iteration, so it guarantees all handlers are returned once on subsequentnext()
invocations.
-
Constructor Details
-
RoundRobinLoadBalancingStrategy
public RoundRobinLoadBalancingStrategy()
-
-
Method Details
-
getHandlerIterator
public final Iterator<MessageHandler> getHandlerIterator(Message<?> message, Collection<MessageHandler> handlers) Returns an iterator that starts at a new point in the collection every time the first part of the list that is skipped will be used at the end of the iteration, so it guarantees all handlers are returned once on subsequentnext()
invocations.- Specified by:
getHandlerIterator
in interfaceLoadBalancingStrategy
-