Package org.apache.camel.model
Class FaultToleranceConfigurationDefinition
- java.lang.Object
-
- org.apache.camel.model.IdentifiedType
-
- org.apache.camel.model.FaultToleranceConfigurationCommon
-
- org.apache.camel.model.FaultToleranceConfigurationDefinition
-
@Metadata(label="configuration,eip") @Configurer(extended=true) public class FaultToleranceConfigurationDefinition extends FaultToleranceConfigurationCommon
MicroProfile Fault Tolerance Circuit Breaker EIP configuration
-
-
Constructor Summary
Constructors Constructor Description FaultToleranceConfigurationDefinition()
FaultToleranceConfigurationDefinition(CircuitBreakerDefinition parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FaultToleranceConfigurationDefinition
bulkheadEnabled(boolean bulkheadEnabled)
Whether bulkhead is enabled or not on the circuit breaker.FaultToleranceConfigurationDefinition
bulkheadExecutorService(String executorService)
References to a custom thread pool to use when bulkhead is enabledFaultToleranceConfigurationDefinition
bulkheadMaxConcurrentCalls(int bulkheadMaxConcurrentCalls)
Configures the max amount of concurrent calls the bulkhead will support.FaultToleranceConfigurationDefinition
bulkheadWaitingTaskQueue(int bulkheadWaitingTaskQueue)
Configures the task queue size for holding waiting tasks to be processed by the bulkheadFaultToleranceConfigurationDefinition
circuitBreaker(String circuitBreaker)
Refers to an existing io.github.resilience4j.circuitbreaker.CircuitBreaker instance to lookup and use from the registry.FaultToleranceConfigurationDefinition
delay(long delay)
Control how long the circuit breaker stays open.FaultToleranceConfigurationDefinition
delay(String delay)
Control how long the circuit breaker stays open.CircuitBreakerDefinition
end()
End of configuration.FaultToleranceConfigurationDefinition
failureRatio(int failureRatio)
Configures the failure rate threshold in percentage.FaultToleranceConfigurationDefinition
requestVolumeThreshold(int requestVolumeThreshold)
Controls the size of the rolling window used when the circuit breaker is closedFaultToleranceConfigurationDefinition
successThreshold(int successThreshold)
Controls the number of trial calls which are allowed when the circuit breaker is half-openFaultToleranceConfigurationDefinition
timeoutDuration(long timeoutDuration)
Configures the thread execution timeout.FaultToleranceConfigurationDefinition
timeoutDuration(String timeoutDuration)
Configures the thread execution timeout.FaultToleranceConfigurationDefinition
timeoutEnabled(boolean timeoutEnabled)
Whether timeout is enabled or not on the circuit breaker.FaultToleranceConfigurationDefinition
timeoutPoolSize(int poolSize)
Configures the pool size of the thread pool when timeout is enabled.FaultToleranceConfigurationDefinition
timeoutScheduledExecutorService(String executorService)
References to a custom thread pool to use when timeout is enabled-
Methods inherited from class org.apache.camel.model.FaultToleranceConfigurationCommon
getBulkheadEnabled, getBulkheadExecutorService, getBulkheadMaxConcurrentCalls, getBulkheadWaitingTaskQueue, getCircuitBreaker, getDelay, getFailureRatio, getRequestVolumeThreshold, getSuccessThreshold, getTimeoutDuration, getTimeoutEnabled, getTimeoutPoolSize, getTimeoutScheduledExecutorService, setBulkheadEnabled, setBulkheadExecutorService, setBulkheadMaxConcurrentCalls, setBulkheadWaitingTaskQueue, setCircuitBreaker, setDelay, setFailureRatio, setRequestVolumeThreshold, setSuccessThreshold, setTimeoutDuration, setTimeoutEnabled, setTimeoutPoolSize, setTimeoutScheduledExecutorService
-
Methods inherited from class org.apache.camel.model.IdentifiedType
getId, setId
-
-
-
-
Constructor Detail
-
FaultToleranceConfigurationDefinition
public FaultToleranceConfigurationDefinition()
-
FaultToleranceConfigurationDefinition
public FaultToleranceConfigurationDefinition(CircuitBreakerDefinition parent)
-
-
Method Detail
-
circuitBreaker
public FaultToleranceConfigurationDefinition circuitBreaker(String circuitBreaker)
Refers to an existing io.github.resilience4j.circuitbreaker.CircuitBreaker instance to lookup and use from the registry. When using this, then any other circuit breaker options are not in use.
-
delay
public FaultToleranceConfigurationDefinition delay(long delay)
Control how long the circuit breaker stays open. The default is 5 seconds.
-
delay
public FaultToleranceConfigurationDefinition delay(String delay)
Control how long the circuit breaker stays open. The default is 5 seconds.
-
successThreshold
public FaultToleranceConfigurationDefinition successThreshold(int successThreshold)
Controls the number of trial calls which are allowed when the circuit breaker is half-open
-
requestVolumeThreshold
public FaultToleranceConfigurationDefinition requestVolumeThreshold(int requestVolumeThreshold)
Controls the size of the rolling window used when the circuit breaker is closed
-
failureRatio
public FaultToleranceConfigurationDefinition failureRatio(int 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.
-
timeoutEnabled
public FaultToleranceConfigurationDefinition timeoutEnabled(boolean timeoutEnabled)
Whether timeout is enabled or not on the circuit breaker. Default is false.
-
timeoutDuration
public FaultToleranceConfigurationDefinition timeoutDuration(long timeoutDuration)
Configures the thread execution timeout. Default value is 1 second.
-
timeoutDuration
public FaultToleranceConfigurationDefinition timeoutDuration(String timeoutDuration)
Configures the thread execution timeout. Default value is 1 second.
-
timeoutPoolSize
public FaultToleranceConfigurationDefinition timeoutPoolSize(int poolSize)
Configures the pool size of the thread pool when timeout is enabled. Default value is 10.
-
timeoutScheduledExecutorService
public FaultToleranceConfigurationDefinition timeoutScheduledExecutorService(String executorService)
References to a custom thread pool to use when timeout is enabled
-
bulkheadEnabled
public FaultToleranceConfigurationDefinition bulkheadEnabled(boolean bulkheadEnabled)
Whether bulkhead is enabled or not on the circuit breaker. Default is false.
-
bulkheadMaxConcurrentCalls
public FaultToleranceConfigurationDefinition bulkheadMaxConcurrentCalls(int bulkheadMaxConcurrentCalls)
Configures the max amount of concurrent calls the bulkhead will support.
-
bulkheadWaitingTaskQueue
public FaultToleranceConfigurationDefinition bulkheadWaitingTaskQueue(int bulkheadWaitingTaskQueue)
Configures the task queue size for holding waiting tasks to be processed by the bulkhead
-
bulkheadExecutorService
public FaultToleranceConfigurationDefinition bulkheadExecutorService(String executorService)
References to a custom thread pool to use when bulkhead is enabled
-
end
public CircuitBreakerDefinition end()
End of configuration.
-
-