Class RetryPolicy.Builder
java.lang.Object
io.micronaut.retry.RetryPolicy.Builder
- Enclosing class:
RetryPolicy
Builder for
RetryPolicy.- Since:
- 5.0.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the retry policy.capturedException(Class<? extends Throwable> capturedException) Sets the captured exception type.Sets the delay between retry attempts.final RetryPolicy.BuilderAdds excluded exception types.final RetryPolicy.BuilderAdds included exception types.jitter(double jitter) Sets the jitter factor.maxAttempts(int maxAttempts) Sets the maximum number of attempts.Sets the maximum overall delay.multiplier(double multiplier) Sets the delay multiplier.predicate(RetryPredicate predicate) Sets the retry predicate.
-
Method Details
-
maxAttempts
Sets the maximum number of attempts.- Parameters:
maxAttempts- The maximum number of attempts- Returns:
- This builder
-
delay
Sets the delay between retry attempts.- Parameters:
delay- The delay between retry attempts- Returns:
- This builder
-
maxDelay
Sets the maximum overall delay.- Parameters:
maxDelay- The maximum overall delay- Returns:
- This builder
-
multiplier
Sets the delay multiplier.- Parameters:
multiplier- The delay multiplier- Returns:
- This builder
-
jitter
Sets the jitter factor.- Parameters:
jitter- The jitter factor- Returns:
- This builder
-
predicate
Sets the retry predicate.- Parameters:
predicate- The retry predicate- Returns:
- This builder
-
capturedException
Sets the captured exception type.- Parameters:
capturedException- The captured exception type- Returns:
- This builder
-
includes
Adds included exception types.- Parameters:
includes- The included exception types- Returns:
- This builder
-
excludes
Adds excluded exception types.- Parameters:
excludes- The excluded exception types- Returns:
- This builder
-
build
-