Class RoundRobinDestinationConnectionStrategy

java.lang.Object
net.logstash.logback.appender.destination.DestinationConnectionStrategyWithTtl
net.logstash.logback.appender.destination.RoundRobinDestinationConnectionStrategy
All Implemented Interfaces:
DestinationConnectionStrategy

public class RoundRobinDestinationConnectionStrategy extends DestinationConnectionStrategyWithTtl
This strategy attempts connections to the destination in round robin order. If a connection fails, the next destination is attempted. The connectionTTL can be set to gracefully close connections after a specific duration. This will force the the appender to reattempt to connect to the next destination.
  • Constructor Details

    • RoundRobinDestinationConnectionStrategy

      public RoundRobinDestinationConnectionStrategy()
  • Method Details

    • selectNextDestinationIndex

      public int selectNextDestinationIndex(int previousDestinationIndex, int numDestinations)
      Description copied from interface: DestinationConnectionStrategy
      Returns the index of the destination to which to connect next.
      Parameters:
      previousDestinationIndex - The previous destination index to which a connection was attempted (either success or failure)
      numDestinations - The total number of destinations available.
      Returns:
      the index of the destination to which to connect next.