Package org.apache.camel.main
Class FaultToleranceConfigurationProperties
java.lang.Object
org.apache.camel.main.FaultToleranceConfigurationProperties
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.camel.spi.BootstrapCloseable
@Configurer(extended=true)
public class FaultToleranceConfigurationProperties
extends Object
implements org.apache.camel.spi.BootstrapCloseable
Global configuration for MicroProfile Fault Tolerance EIP circuit breaker.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()end()getDelay()voidsetBulkheadEnabled(Boolean bulkheadEnabled) Whether bulkhead is enabled or not on the circuit breaker.voidsetBulkheadMaxConcurrentCalls(Integer bulkheadMaxConcurrentCalls) Configures the max amount of concurrent calls the bulkhead will support.voidsetBulkheadWaitingTaskQueue(Integer bulkheadWaitingTaskQueue) Configures the task queue size for holding waiting tasks to be processed by the bulkhead.voidControl how long the circuit breaker stays open.voidsetFailureRatio(Integer failureRatio) Configures the failure rate threshold in percentage.voidsetRequestVolumeThreshold(Integer requestVolumeThreshold) Controls the size of the rolling window used when the circuit breaker is closed Default value is 20.voidsetSuccessThreshold(Integer successThreshold) Controls the number of trial calls which are allowed when the circuit breaker is half-open Default value is 1.voidsetThreadOffloadExecutorService(String threadOffloadExecutorService) References a custom thread pool to use when offloading a guarded action to another thread.voidsetTimeoutDuration(Long timeoutDuration) Configures the thread execution timeout.voidsetTimeoutEnabled(Boolean timeoutEnabled) Whether timeout is enabled or not on the circuit breaker.voidsetTimeoutPoolSize(Integer timeoutPoolSize) Configures the pool size of the thread pool when timeout is enabled.voidsetTypedGuard(String typedGuard) Refers to an existing io.smallrye.faulttolerance.api.TypedGuard instance to lookup and use from the registry.withBulkheadEnabled(Boolean bulkheadEnabled) Whether bulkhead is enabled or not on the circuit breaker.withBulkheadMaxConcurrentCalls(Integer bulkheadMaxConcurrentCalls) Configures the max amount of concurrent calls the bulkhead will support.withBulkheadWaitingTaskQueue(Integer bulkheadWaitingTaskQueue) Configures the task queue size for holding waiting tasks to be processed by the bulkhead.Control how long the circuit breaker stays open.withFailureRatio(Integer failureRatio) Configures the failure rate threshold in percentage.withRequestVolumeThreshold(Integer requestVolumeThreshold) Controls the size of the rolling window used when the circuit breaker is closed Default value is 20.withSuccessThreshold(Integer successThreshold) Controls the number of trial calls which are allowed when the circuit breaker is half-open Default value is 1.withThreadOffloadExecutorServiceRef(String threadOffloadExecutorServiceRef) References a custom thread pool to use when offloading a guarded action to another thread.withTimeoutDuration(Long timeoutDuration) Configures the thread execution timeout.withTimeoutEnabled(Boolean timeoutEnabled) Whether timeout is enabled or not on the circuit breaker.withTimeoutPoolSize(Integer timeoutPoolSize) Configures the pool size of the thread pool when timeout is enabled.withTypedGuard(String typedGuard) Refers to an existing io.smallrye.faulttolerance.api.TypedGuard instance to lookup and use from the registry.
-
Constructor Details
-
FaultToleranceConfigurationProperties
-
-
Method Details
-
end
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getTypedGuard
-
setTypedGuard
Refers to an existing io.smallrye.faulttolerance.api.TypedGuard instance to lookup and use from the registry. When using this, then any other TypedGuard circuit breaker options are not in use. -
getDelay
-
setDelay
Control how long the circuit breaker stays open. The value are in seconds and the default is 5 seconds. -
getSuccessThreshold
-
setSuccessThreshold
Controls the number of trial calls which are allowed when the circuit breaker is half-open Default value is 1. -
getRequestVolumeThreshold
-
setRequestVolumeThreshold
Controls the size of the rolling window used when the circuit breaker is closed Default value is 20. -
getFailureRatio
-
setFailureRatio
Configures the failure rate threshold in percentage. If the failure rate is equal or greater than the threshold the CircuitBreaker transitions to open and starts short-circuiting calls.The threshold must be greater than 0 and not greater than 100. Default value is 50 percentage.
-
getTimeoutEnabled
-
setTimeoutEnabled
Whether timeout is enabled or not on the circuit breaker. Default is false. -
getTimeoutDuration
-
setTimeoutDuration
Configures the thread execution timeout. Default value is 1000 milliseconds. -
getTimeoutPoolSize
-
setTimeoutPoolSize
Configures the pool size of the thread pool when timeout is enabled. Default value is 10. -
getBulkheadEnabled
-
setBulkheadEnabled
Whether bulkhead is enabled or not on the circuit breaker. Default is false. -
getBulkheadMaxConcurrentCalls
-
setBulkheadMaxConcurrentCalls
Configures the max amount of concurrent calls the bulkhead will support. Default value is 10. -
getBulkheadWaitingTaskQueue
-
setBulkheadWaitingTaskQueue
Configures the task queue size for holding waiting tasks to be processed by the bulkhead. Default value is 10. -
getThreadOffloadExecutorService
-
setThreadOffloadExecutorService
References a custom thread pool to use when offloading a guarded action to another thread. -
withTypedGuard
Refers to an existing io.smallrye.faulttolerance.api.TypedGuard instance to lookup and use from the registry. When using this, then any other TypedGuard circuit breaker options are not in use. -
withDelay
Control how long the circuit breaker stays open. The value are in seconds and the default is 5 seconds. -
withSuccessThreshold
Controls the number of trial calls which are allowed when the circuit breaker is half-open Default value is 1. -
withRequestVolumeThreshold
public FaultToleranceConfigurationProperties withRequestVolumeThreshold(Integer requestVolumeThreshold) Controls the size of the rolling window used when the circuit breaker is closed Default value is 20. -
withFailureRatio
Configures the failure rate threshold in percentage. If the failure rate is equal or greater than the threshold the CircuitBreaker transitions to open and starts short-circuiting calls.The threshold must be greater than 0 and not greater than 100. Default value is 50 percentage.
-
withTimeoutEnabled
Whether timeout is enabled or not on the circuit breaker. Default is false. -
withTimeoutDuration
Configures the thread execution timeout. Default value is 1000 milliseconds. -
withTimeoutPoolSize
Configures the pool size of the thread pool when timeout is enabled. Default value is 10. -
withBulkheadEnabled
Whether bulkhead is enabled or not on the circuit breaker. Default is false. -
withBulkheadMaxConcurrentCalls
public FaultToleranceConfigurationProperties withBulkheadMaxConcurrentCalls(Integer bulkheadMaxConcurrentCalls) Configures the max amount of concurrent calls the bulkhead will support. Default value is 10. -
withBulkheadWaitingTaskQueue
public FaultToleranceConfigurationProperties withBulkheadWaitingTaskQueue(Integer bulkheadWaitingTaskQueue) Configures the task queue size for holding waiting tasks to be processed by the bulkhead. Default value is 10. -
withThreadOffloadExecutorServiceRef
public FaultToleranceConfigurationProperties withThreadOffloadExecutorServiceRef(String threadOffloadExecutorServiceRef) References a custom thread pool to use when offloading a guarded action to another thread.
-