public class RandomDestinationConnectionStrategy extends DestinationConnectionStrategyWithTtl
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 random destination.
| Constructor and Description |
|---|
RandomDestinationConnectionStrategy() |
RandomDestinationConnectionStrategy(UnaryOperator<Integer> randomSupplier) |
| Modifier and Type | Method and Description |
|---|---|
int |
selectNextDestinationIndex(int previousDestinationIndex,
int numDestinations)
Returns the index of the destination to which to connect next.
|
connectFailed, connectSuccess, getConnectionTTL, setConnectionTTL, shouldReconnectpublic RandomDestinationConnectionStrategy()
public RandomDestinationConnectionStrategy(UnaryOperator<Integer> randomSupplier)
public int selectNextDestinationIndex(int previousDestinationIndex,
int numDestinations)
DestinationConnectionStrategypreviousDestinationIndex - The previous destination index to which a connection was attempted (either success or failure)numDestinations - The total number of destinations available.Copyright © 2013–2022. All rights reserved.