Package io.hekate.messaging.retry
Interface RetryErrorPredicate
-
- 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 RetryErrorPredicate
Predicate to test if particular error should be retried.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static RetryErrorPredicate
acceptAll()
Always retry.static RetryErrorPredicate
rejectAll()
Never retry.boolean
shouldRetry(FailedAttempt err)
Decides on whether the specified error should be retried.
-
-
-
Method Detail
-
shouldRetry
boolean shouldRetry(FailedAttempt err)
Decides on whether the specified error should be retried.- Parameters:
err
- Failure.- Returns:
true
if operation should be retried.
-
rejectAll
static RetryErrorPredicate rejectAll()
Never retry.- Returns:
- Policy that rejects all errors.
-
acceptAll
static RetryErrorPredicate acceptAll()
Always retry.- Returns:
- Policy that always retries.
-
-