Class ExponentialBackOffWithMaxRetries
- java.lang.Object
-
- org.springframework.util.backoff.ExponentialBackOff
-
- org.springframework.kafka.support.ExponentialBackOffWithMaxRetries
-
- All Implemented Interfaces:
org.springframework.util.backoff.BackOff
public class ExponentialBackOffWithMaxRetries extends org.springframework.util.backoff.ExponentialBackOff
Subclass ofExponentialBackOff
that allows the specification of the maximum number of retries rather than the maximum elapsed time.- Since:
- 2.7.3
- Author:
- Gary Russell
-
-
Constructor Summary
Constructors Constructor Description ExponentialBackOffWithMaxRetries(int maxRetries)
Construct an instance that will calculate thesetMaxElapsedTime(long)
from the maxRetries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMaxRetries()
Get the max retries.void
setInitialInterval(long initialInterval)
void
setMaxElapsedTime(long maxElapsedTime)
void
setMaxInterval(long maxInterval)
void
setMultiplier(double multiplier)
-
-
-
Constructor Detail
-
ExponentialBackOffWithMaxRetries
public ExponentialBackOffWithMaxRetries(int maxRetries)
Construct an instance that will calculate thesetMaxElapsedTime(long)
from the maxRetries.- Parameters:
maxRetries
- the max retries.
-
-
Method Detail
-
getMaxRetries
public int getMaxRetries()
Get the max retries.- Returns:
- the max retries.
-
setInitialInterval
public void setInitialInterval(long initialInterval)
- Overrides:
setInitialInterval
in classorg.springframework.util.backoff.ExponentialBackOff
-
setMultiplier
public void setMultiplier(double multiplier)
- Overrides:
setMultiplier
in classorg.springframework.util.backoff.ExponentialBackOff
-
setMaxInterval
public void setMaxInterval(long maxInterval)
- Overrides:
setMaxInterval
in classorg.springframework.util.backoff.ExponentialBackOff
-
setMaxElapsedTime
public void setMaxElapsedTime(long maxElapsedTime)
- Overrides:
setMaxElapsedTime
in classorg.springframework.util.backoff.ExponentialBackOff
-
-