public class ExponentialBackoffRetryStrategy extends Object implements RetryStrategy
RetryStrategy
that retries that has an exponential backoff with a
cap.Constructor and Description |
---|
ExponentialBackoffRetryStrategy(int remainingRetries,
Duration currentRetryDelay,
Duration maxRetryDelay) |
Modifier and Type | Method and Description |
---|---|
RetryStrategy |
getNextRetryStrategy() |
int |
getNumRemainingRetries() |
Duration |
getRetryDelay() |
public ExponentialBackoffRetryStrategy(int remainingRetries, Duration currentRetryDelay, Duration maxRetryDelay)
remainingRetries
- number of times to retrycurrentRetryDelay
- the current delay between retriesmaxRetryDelay
- the max delay between retriespublic int getNumRemainingRetries()
getNumRemainingRetries
in interface RetryStrategy
public Duration getRetryDelay()
getRetryDelay
in interface RetryStrategy
public RetryStrategy getNextRetryStrategy()
getNextRetryStrategy
in interface RetryStrategy
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.