Interface Retry.RetryContext

Enclosing interface:
Retry

@NullMarked public static interface Retry.RetryContext
Encapsulates runtime contextual metadata associated with the current retry iteration.
  • Method Summary

    Modifier and Type
    Method
    Description
    The exception that caused the previous execution attempt to fail.
    long
    The current attempt index of the retry lifecycle (1-based index).
    long
    The total maximum number of retries configured in the strategy.
  • Method Details

    • iteration

      long iteration()
      The current attempt index of the retry lifecycle (1-based index).
      Returns:
      The current iteration number.
    • totalRetries

      long totalRetries()
      The total maximum number of retries configured in the strategy.
      Returns:
      The maximum allowable attempts.
    • exception

      Throwable exception()
      The exception that caused the previous execution attempt to fail.
      Returns:
      The root or wrapped Throwable.