Class RetryContext


  • public final class RetryContext
    extends java.lang.Object
    Context data that's provided to RetryHandler implementations.
    • Method Detail

      • getLastFailure

        public FailureDetails getLastFailure()
        Gets the details of the previous task failure, including the exception type, message, and callstack.
        Returns:
        the details of the previous task failure
      • getLastAttemptNumber

        public int getLastAttemptNumber()
        Gets the previous retry attempt number. This number starts at 1 and increments each time the retry handler is invoked for a particular task failure.
        Returns:
        the previous retry attempt number
      • getTotalRetryTime

        public java.time.Duration getTotalRetryTime()
        Gets the total amount of time spent in a retry loop for the current task.
        Returns:
        the total amount of time spent in a retry loop for the current task