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
Nested ClassesModifier and TypeClassDescriptionstatic classA builder used for setting up a customized list of fault tolerance handlers.static classA builder used for fault tolerance handlers that require a specific type to be used, such asFallback. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfig key to enable metrics in Fault Tolerance. -
Method Summary
Modifier and TypeMethodDescriptionstatic FaultTolerance.Builderbuilder()A builder to configure a customized sequence of fault tolerance handlers.static voidDeprecated, for removal: This API element is subject to removal in a future version.static voidexecutor(Supplier<? extends ExecutorService> executor) Deprecated, for removal: This API element is subject to removal in a future version.this method will be removed without replacement; each fault tolerance component that supports executor service can be configured with such explicitly in its builder (i.e.static <T> Callable<T> toDelayedCallable(Callable<T> callable, long millis) Deprecated, for removal: This API element is subject to removal in a future version.this method was not intended for public use, and will be removed in a future version of Helidonstatic RunnabletoDelayedRunnable(Runnable runnable, long millis) Deprecated, for removal: This API element is subject to removal in a future version.this method was not intended for public use, and will be removed in a future version of Helidonstatic <T> FaultTolerance.TypedBuilder<T> A typed builder to configure a customized sequence of fault tolerance handlers.
-
Field Details
-
FT_METRICS_DEFAULT_ENABLED
Config key to enable metrics in Fault Tolerance. This flag can be overridden by each FT command builder. See for exampleBulkheadConfigBlueprint.enableMetrics(). All metrics are disabled by default.- See Also:
-
-
Method Details
-
config
Deprecated, for removal: This API element is subject to removal in a future version.Configure Helidon wide defaults from a config instance. The default is now to useServices.get(Class)to get a configuration. This method will work as it used to, but fallback will always be to the config instance provided by service registry.- Parameters:
config- config to read fault tolerance configuration
-
executor
@Deprecated(forRemoval=true, since="4.3.0") public static void executor(Supplier<? extends ExecutorService> executor) Deprecated, for removal: This API element is subject to removal in a future version.this method will be removed without replacement; each fault tolerance component that supports executor service can be configured with such explicitly in its builder (i.e.AsyncConfig.BuilderBase.executor(java.util.concurrent.ExecutorService)). When using declarative, the executor service can be configured as a named service.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
@Deprecated(forRemoval=true, since="4.3.0") public static Runnable toDelayedRunnable(Runnable runnable, long millis) Deprecated, for removal: This API element is subject to removal in a future version.this method was not intended for public use, and will be removed in a future version of HelidonConverts aRunnableinto another that sleeps formillisbefore executing. Simulates a scheduled executor when using VTs.- Parameters:
runnable- the runnablemillis- the time to sleep- Returns:
- the new runnable
-
toDelayedCallable
@Deprecated(forRemoval=true, since="4.3.0") public static <T> Callable<T> toDelayedCallable(Callable<T> callable, long millis) Deprecated, for removal: This API element is subject to removal in a future version.this method was not intended for public use, and will be removed in a future version of HelidonConverts aCallableinto another that sleeps formillisbefore 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
-