Class RoundRobinLoadBalancingStrategy

java.lang.Object
org.springframework.integration.dispatcher.RoundRobinLoadBalancingStrategy
All Implemented Interfaces:
LoadBalancingStrategy

public class RoundRobinLoadBalancingStrategy extends Object implements 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
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final Iterator<org.springframework.messaging.MessageHandler>
    getHandlerIterator(org.springframework.messaging.Message<?> message, Collection<org.springframework.messaging.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 subsequent next() invocations.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RoundRobinLoadBalancingStrategy

      public RoundRobinLoadBalancingStrategy()
  • Method Details

    • getHandlerIterator

      public final Iterator<org.springframework.messaging.MessageHandler> getHandlerIterator(org.springframework.messaging.Message<?> message, Collection<org.springframework.messaging.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 subsequent next() invocations.
      Specified by:
      getHandlerIterator in interface LoadBalancingStrategy