Interface BackoffSupplier

All Known Implementing Classes:
ExponentialBackoff
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface BackoffSupplier
The JobWorker uses this interface to determine the retry delay after each failed request. After a successful request, or if no requests have been sent yet, the delay is reset to the job worker's polling interval (see JobWorkerBuilderStep1.JobWorkerBuilderStep3.pollInterval(Duration)).

The supplier is called after a failed request. The worker will then await the supplied delay before sending the next request.

  • Method Details

    • newBackoffBuilder

      static ExponentialBackoffBuilder newBackoffBuilder()
      Returns:
      a builder to configure and create a new exponential backoff ExponentialBackoff.
    • supplyRetryDelay

      long supplyRetryDelay(long currentRetryDelay)
      Returns the delay before the next retry. The delay should be specified in milliseconds.
      Parameters:
      currentRetryDelay - the last used retry delay
      Returns:
      the new retry delay