Interface RetryStrategy

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 RetryStrategy
Functional interface for determining retry behavior when operations fail.

A RetryStrategy evaluates failed operations and decides whether they should be retried and how long to wait before the next attempt.

  • Method Summary

    Modifier and Type
    Method
    Description
    makeRetryDecision(Throwable error, int attemptNumber)
    Determines whether to retry a failed operation and calculates the retry delay.
  • Method Details

    • makeRetryDecision

      RetryDecision makeRetryDecision(Throwable error, int attemptNumber)
      Determines whether to retry a failed operation and calculates the retry delay.
      Parameters:
      error - The error that occurred during the operation
      attemptNumber - The current attempt number (0-based, so first attempt is 0)
      Returns:
      RetryDecision indicating whether to retry and the delay before next attempt