java.lang.Object
io.helidon.faulttolerance.Retry.Builder
- All Implemented Interfaces:
Builder<Retry.Builder,,Retry> Supplier<Retry>
- Enclosing interface:
- Retry
Fluent API builder for
Retry.-
Method Summary
Modifier and TypeMethodDescriptionaddApplyOn(Class<? extends Throwable> clazz) Add a throwable to be considered a failure.This throwable will not be considered retriable.final Retry.BuilderThese throwables will be considered failures, and all other will not.build()Build the instance from this builder.A name assigned for debugging, error reporting or configuration purposes.overallTimeout(Duration overallTimeout) Overall timeout.retryPolicy(Retry.RetryPolicy policy) Configure a retry policy to use to calculate delays between retries.scheduledExecutor(ScheduledExecutorService scheduledExecutor) Executor service to schedule retries.final Retry.BuilderThese throwables will not be considered retriable, all other will.
-
Method Details
-
build
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<Retry.Builder,Retry> - Returns:
- instance of the built type
-
retryPolicy
Configure a retry policy to use to calculate delays between retries. Defaults to aRetry.JitterRetryPolicywith 4 calls (initial call + 3 retries), delay of 200 millis and a jitter of 50 millis.- Parameters:
policy- retry policy- Returns:
- updated builder instance
-
applyOn
These throwables will be considered failures, and all other will not.Cannot be combined with
skipOn.- Parameters:
classes- to consider failures and trigger a retry- Returns:
- updated builder instance
-
addApplyOn
Add a throwable to be considered a failure.- Parameters:
clazz- to consider failure and trigger a retry- Returns:
- updated builder instance
- See Also:
-
applyOn
-
skipOn
These throwables will not be considered retriable, all other will.Cannot be combined with
applyOn.- Parameters:
classes- to skip retries- Returns:
- updated builder instance
-
addSkipOn
This throwable will not be considered retriable.- Parameters:
clazz- to to skip retries- Returns:
- updated builder instance
-
scheduledExecutor
Executor service to schedule retries. By default uses an executor configured onFaultTolerance.scheduledExecutor(java.util.function.Supplier).- Parameters:
scheduledExecutor- executor to use- Returns:
- updated builder instance
-
overallTimeout
Overall timeout. When overall timeout is reached, execution terminates (even if the retry policy was not exhausted).- Parameters:
overallTimeout- an overall timeout- Returns:
- updated builder instance
-
name
A name assigned for debugging, error reporting or configuration purposes.- Parameters:
name- the name- Returns:
- updated builder instance
-