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.
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 TypeMethodDescriptionmakeRetryDecision(Throwable error, int attempt) Determines whether to retry a failed operation and calculates the retry delay.
-
Method Details
-
makeRetryDecision
Determines whether to retry a failed operation and calculates the retry delay.- Parameters:
error- The error that occurred during the operationattempt- The current attempt number (1-based, so first attempt is 1)- Returns:
- RetryDecision indicating whether to retry and the delay before next attempt
-