java.lang.Object
io.helidon.faulttolerance.FaultTolerance
System-wide fault tolerance configuration and access to a customized sequence of fault tolerance handlers.
Fault tolerance provides the following features:
Bulkhead
- limit number of parallel requests to a resourceCircuitBreaker
- stop trying to request a failing resource until it becomes availableFallback
- fall back to another supplier of result in case the usual one failsRetry
- try to call a supplier again if invocation failsTimeout
- time out a request if it takes too long
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder used for setting up a customized list of fault tolerance handlers.static class
A builder used for fault tolerance handlers that require a specific type to be used, such asFallback
. -
Method Summary
Modifier and TypeMethodDescriptionstatic FaultTolerance.Builder
builder()
A builder to configure a customized sequence of fault tolerance handlers.static void
Configure Helidon wide defaults from a config instance.static void
executor
(Supplier<? extends ExecutorService> executor) Configure Helidon wide executor service for Fault Tolerance.static <T> Callable
<T> toDelayedCallable
(Callable<T> callable, long millis) Converts aCallable
into another that sleeps formillis
before executing.static Runnable
toDelayedRunnable
(Runnable runnable, long millis) Converts aRunnable
into another that sleeps formillis
before executing.static <T> FaultTolerance.TypedBuilder
<T> A typed builder to configure a customized sequence of fault tolerance handlers.
-
Method Details
-
config
Configure Helidon wide defaults from a config instance.- Parameters:
config
- config to read fault tolerance configuration
-
executor
Configure Helidon wide executor service for Fault Tolerance.- Parameters:
executor
- executor service to use
-
builder
A builder to configure a customized sequence of fault tolerance handlers.- Returns:
- a new builder
-
typedBuilder
A typed builder to configure a customized sequence of fault tolerance handlers.- Type Parameters:
T
- type of result- Returns:
- a new builder
-
toDelayedRunnable
Converts aRunnable
into another that sleeps formillis
before executing. Simulates a scheduled executor when using VTs.- Parameters:
runnable
- the runnablemillis
- the time to sleep- Returns:
- the new runnable
-
toDelayedCallable
Converts aCallable
into another that sleeps formillis
before executing. Simulates a scheduled executor when using VTs.- Type Parameters:
T
- type of value returned- Parameters:
callable
- the callablemillis
- the time to sleep- Returns:
- the new callable
-