Class ExponentialBackOffWithMaxRetries

java.lang.Object
org.springframework.util.backoff.ExponentialBackOff
org.springframework.kafka.support.ExponentialBackOffWithMaxRetries
All Implemented Interfaces:
BackOff

public class ExponentialBackOffWithMaxRetries extends ExponentialBackOff
Subclass of ExponentialBackOff that allows the specification of the maximum number of retries rather than the maximum elapsed time.

With a jitter, the intervals vary, so the number of retries is only limited by ExponentialBackOff.getMaxAttempts(), and the maximum elapsed time is not limited.

Since:
2.7.3
Author:
Gary Russell, Jialin Chen, Yingzi Zhang
  • Constructor Details

    • ExponentialBackOffWithMaxRetries

      public ExponentialBackOffWithMaxRetries(int maxRetries)
      Construct an instance that will calculate the setMaxElapsedTime(long) from the maxRetries.
      Parameters:
      maxRetries - the max retries; 0 or less for no retries.
  • Method Details