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(bootstrap=true, extended=true) public class FaultToleranceConfigurationProperties extends Object implements org.apache.camel.spi.BootstrapCloseableGlobal configuration for MicroProfile Fault Tolerance EIP circuit breaker.
-
-
Constructor Summary
Constructors Constructor Description FaultToleranceConfigurationProperties(MainConfigurationProperties parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()MainConfigurationPropertiesend()BooleangetBulkheadEnabled()StringgetBulkheadExecutorService()IntegergetBulkheadMaxConcurrentCalls()IntegergetBulkheadWaitingTaskQueue()StringgetCircuitBreaker()LonggetDelay()IntegergetFailureRatio()IntegergetRequestVolumeThreshold()IntegergetSuccessThreshold()LonggetTimeoutDuration()BooleangetTimeoutEnabled()IntegergetTimeoutPoolSize()StringgetTimeoutScheduledExecutorService()voidsetBulkheadEnabled(Boolean bulkheadEnabled)Whether bulkhead is enabled or not on the circuit breaker.voidsetBulkheadExecutorService(String bulkheadExecutorService)References to a custom thread pool to use when bulkhead is enabled.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.voidsetCircuitBreaker(String circuitBreaker)Refers to an existing io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker instance to lookup and use from the registry.voidsetDelay(Long delay)Control 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.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.voidsetTimeoutScheduledExecutorService(String timeoutScheduledExecutorService)References to a custom thread pool to use when timeout is enabledFaultToleranceConfigurationPropertieswithBulkheadEnabled(Boolean bulkheadEnabled)Whether bulkhead is enabled or not on the circuit breaker.FaultToleranceConfigurationPropertieswithBulkheadExecutorServiceRef(String bulkheadExecutorServiceRef)References to a custom thread pool to use when bulkhead is enabled.FaultToleranceConfigurationPropertieswithBulkheadMaxConcurrentCalls(Integer bulkheadMaxConcurrentCalls)Configures the max amount of concurrent calls the bulkhead will support.FaultToleranceConfigurationPropertieswithBulkheadWaitingTaskQueue(Integer bulkheadWaitingTaskQueue)Configures the task queue size for holding waiting tasks to be processed by the bulkhead.FaultToleranceConfigurationPropertieswithCircuitBreakerRef(String circuitBreakerRef)Refers to an existing io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker instance to lookup and use from the registry.FaultToleranceConfigurationPropertieswithDelay(Long delay)Control how long the circuit breaker stays open.FaultToleranceConfigurationPropertieswithFailureRatio(Integer failureRatio)Configures the failure rate threshold in percentage.FaultToleranceConfigurationPropertieswithRequestVolumeThreshold(Integer requestVolumeThreshold)Controls the size of the rolling window used when the circuit breaker is closed Default value is 20.FaultToleranceConfigurationPropertieswithSuccessThreshold(Integer successThreshold)Controls the number of trial calls which are allowed when the circuit breaker is half-open Default value is 1.FaultToleranceConfigurationPropertieswithTimeoutDuration(Long timeoutDuration)Configures the thread execution timeout.FaultToleranceConfigurationPropertieswithTimeoutEnabled(Boolean timeoutEnabled)Whether timeout is enabled or not on the circuit breaker.FaultToleranceConfigurationPropertieswithTimeoutPoolSize(Integer timeoutPoolSize)Configures the pool size of the thread pool when timeout is enabled.FaultToleranceConfigurationPropertieswithTimeoutScheduledExecutorServiceRef(String timeoutScheduledExecutorServiceRef)References to a custom thread pool to use when timeout is enabled
-
-
-
Constructor Detail
-
FaultToleranceConfigurationProperties
public FaultToleranceConfigurationProperties(MainConfigurationProperties parent)
-
-
Method Detail
-
end
public MainConfigurationProperties end()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getCircuitBreaker
public String getCircuitBreaker()
-
setCircuitBreaker
public void setCircuitBreaker(String circuitBreaker)
Refers to an existing io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker instance to lookup and use from the registry. When using this, then any other circuit breaker options are not in use.
-
getDelay
public Long getDelay()
-
setDelay
public void setDelay(Long delay)
Control how long the circuit breaker stays open. The value are in seconds and the default is 5 seconds.
-
getSuccessThreshold
public Integer getSuccessThreshold()
-
setSuccessThreshold
public void setSuccessThreshold(Integer successThreshold)
Controls the number of trial calls which are allowed when the circuit breaker is half-open Default value is 1.
-
getRequestVolumeThreshold
public Integer getRequestVolumeThreshold()
-
setRequestVolumeThreshold
public void setRequestVolumeThreshold(Integer requestVolumeThreshold)
Controls the size of the rolling window used when the circuit breaker is closed Default value is 20.
-
getFailureRatio
public Integer getFailureRatio()
-
setFailureRatio
public void setFailureRatio(Integer failureRatio)
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
public Boolean getTimeoutEnabled()
-
setTimeoutEnabled
public void setTimeoutEnabled(Boolean timeoutEnabled)
Whether timeout is enabled or not on the circuit breaker. Default is false.
-
getTimeoutDuration
public Long getTimeoutDuration()
-
setTimeoutDuration
public void setTimeoutDuration(Long timeoutDuration)
Configures the thread execution timeout. Default value is 1000 milliseconds.
-
getTimeoutPoolSize
public Integer getTimeoutPoolSize()
-
setTimeoutPoolSize
public void setTimeoutPoolSize(Integer timeoutPoolSize)
Configures the pool size of the thread pool when timeout is enabled. Default value is 10.
-
getTimeoutScheduledExecutorService
public String getTimeoutScheduledExecutorService()
-
setTimeoutScheduledExecutorService
public void setTimeoutScheduledExecutorService(String timeoutScheduledExecutorService)
References to a custom thread pool to use when timeout is enabled
-
getBulkheadEnabled
public Boolean getBulkheadEnabled()
-
setBulkheadEnabled
public void setBulkheadEnabled(Boolean bulkheadEnabled)
Whether bulkhead is enabled or not on the circuit breaker. Default is false.
-
getBulkheadMaxConcurrentCalls
public Integer getBulkheadMaxConcurrentCalls()
-
setBulkheadMaxConcurrentCalls
public void setBulkheadMaxConcurrentCalls(Integer bulkheadMaxConcurrentCalls)
Configures the max amount of concurrent calls the bulkhead will support. Default value is 10.
-
getBulkheadWaitingTaskQueue
public Integer getBulkheadWaitingTaskQueue()
-
setBulkheadWaitingTaskQueue
public void setBulkheadWaitingTaskQueue(Integer bulkheadWaitingTaskQueue)
Configures the task queue size for holding waiting tasks to be processed by the bulkhead. Default value is 10.
-
getBulkheadExecutorService
public String getBulkheadExecutorService()
-
setBulkheadExecutorService
public void setBulkheadExecutorService(String bulkheadExecutorService)
References to a custom thread pool to use when bulkhead is enabled.
-
withCircuitBreakerRef
public FaultToleranceConfigurationProperties withCircuitBreakerRef(String circuitBreakerRef)
Refers to an existing io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker instance to lookup and use from the registry. When using this, then any other circuit breaker options are not in use.
-
withDelay
public FaultToleranceConfigurationProperties withDelay(Long delay)
Control how long the circuit breaker stays open. The value are in seconds and the default is 5 seconds.
-
withSuccessThreshold
public FaultToleranceConfigurationProperties withSuccessThreshold(Integer successThreshold)
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
public FaultToleranceConfigurationProperties withFailureRatio(Integer failureRatio)
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
public FaultToleranceConfigurationProperties withTimeoutEnabled(Boolean timeoutEnabled)
Whether timeout is enabled or not on the circuit breaker. Default is false.
-
withTimeoutDuration
public FaultToleranceConfigurationProperties withTimeoutDuration(Long timeoutDuration)
Configures the thread execution timeout. Default value is 1000 milliseconds.
-
withTimeoutPoolSize
public FaultToleranceConfigurationProperties withTimeoutPoolSize(Integer timeoutPoolSize)
Configures the pool size of the thread pool when timeout is enabled. Default value is 10.
-
withTimeoutScheduledExecutorServiceRef
public FaultToleranceConfigurationProperties withTimeoutScheduledExecutorServiceRef(String timeoutScheduledExecutorServiceRef)
References to a custom thread pool to use when timeout is enabled
-
withBulkheadEnabled
public FaultToleranceConfigurationProperties withBulkheadEnabled(Boolean bulkheadEnabled)
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.
-
withBulkheadExecutorServiceRef
public FaultToleranceConfigurationProperties withBulkheadExecutorServiceRef(String bulkheadExecutorServiceRef)
References to a custom thread pool to use when bulkhead is enabled.
-
-