Class ExponentialBackOffWithMaxRetries
java.lang.Object
org.springframework.util.backoff.ExponentialBackOff
org.springframework.kafka.support.ExponentialBackOffWithMaxRetries
- All Implemented Interfaces:
BackOff
Subclass of
ExponentialBackOff
that allows the specification of the maximum
number of retries rather than the maximum elapsed time.- Since:
- 2.7.3
- Author:
- Gary Russell
-
Field Summary
Fields inherited from class org.springframework.util.backoff.ExponentialBackOff
DEFAULT_INITIAL_INTERVAL, DEFAULT_MAX_ELAPSED_TIME, DEFAULT_MAX_INTERVAL, DEFAULT_MULTIPLIER
-
Constructor Summary
ConstructorDescriptionExponentialBackOffWithMaxRetries
(int maxRetries) Construct an instance that will calculate thesetMaxElapsedTime(long)
from the maxRetries. -
Method Summary
Modifier and TypeMethodDescriptionint
Get the max retries.void
setInitialInterval
(long initialInterval) void
setMaxElapsedTime
(long maxElapsedTime) void
setMaxInterval
(long maxInterval) void
setMultiplier
(double multiplier) Methods inherited from class org.springframework.util.backoff.ExponentialBackOff
getInitialInterval, getMaxElapsedTime, getMaxInterval, getMultiplier, start
-
Constructor Details
-
ExponentialBackOffWithMaxRetries
public ExponentialBackOffWithMaxRetries(int maxRetries) Construct an instance that will calculate thesetMaxElapsedTime(long)
from the maxRetries.- Parameters:
maxRetries
- the max retries.
-
-
Method Details
-
getMaxRetries
public int getMaxRetries()Get the max retries.- Returns:
- the max retries.
-
setInitialInterval
public void setInitialInterval(long initialInterval) - Overrides:
setInitialInterval
in classExponentialBackOff
-
setMultiplier
public void setMultiplier(double multiplier) - Overrides:
setMultiplier
in classExponentialBackOff
-
setMaxInterval
public void setMaxInterval(long maxInterval) - Overrides:
setMaxInterval
in classExponentialBackOff
-
setMaxElapsedTime
public void setMaxElapsedTime(long maxElapsedTime) - Overrides:
setMaxElapsedTime
in classExponentialBackOff
-