@Metadata(label="eip,routing,circuitbreaker") public class Resilience4jConfigurationDefinition extends Resilience4jConfigurationCommon
| Constructor and Description |
|---|
Resilience4jConfigurationDefinition() |
Resilience4jConfigurationDefinition(CircuitBreakerDefinition parent) |
| Modifier and Type | Method and Description |
|---|---|
Resilience4jConfigurationDefinition |
automaticTransitionFromOpenToHalfOpenEnabled(Boolean automaticTransitionFromOpenToHalfOpenEnabled)
Enables automatic transition from OPEN to HALF_OPEN state once the waitDurationInOpenState has passed.
|
Resilience4jConfigurationDefinition |
bulkheadEnabled(Boolean bulkheadEnabled)
Whether bulkhead is enabled or not on the circuit breaker.
|
Resilience4jConfigurationDefinition |
bulkheadMaxConcurrentCalls(Integer bulkheadMaxConcurrentCalls)
Configures the max amount of concurrent calls the bulkhead will support.
|
Resilience4jConfigurationDefinition |
bulkheadMaxWaitDuration(Integer bulkheadMaxWaitDuration)
Configures a maximum amount of time which the calling thread will wait to enter the bulkhead.
|
Resilience4jConfigurationDefinition |
circuitBreakerRef(String circuitBreakerRef)
Refers to an existing io.github.resilience4j.circuitbreaker.CircuitBreaker instance
to lookup and use from the registry.
|
Resilience4jConfigurationDefinition |
configRef(String ref)
Refers to an existing io.github.resilience4j.circuitbreaker.CircuitBreakerConfig instance
to lookup and use from the registry.
|
CircuitBreakerDefinition |
end()
End of configuration.
|
Resilience4jConfigurationDefinition |
failureRateThreshold(Float failureRateThreshold)
Configures the failure rate threshold in percentage.
|
Resilience4jConfigurationDefinition |
minimumNumberOfCalls(Integer minimumNumberOfCalls)
Configures configures the minimum number of calls which are required (per sliding window period) before the CircuitBreaker can calculate the error rate.
|
Resilience4jConfigurationDefinition |
permittedNumberOfCallsInHalfOpenState(Integer permittedNumberOfCallsInHalfOpenState)
Configures the number of permitted calls when the CircuitBreaker is half open.
|
Resilience4jConfigurationDefinition |
slidingWindowSize(Integer slidingWindowSize)
Configures the size of the sliding window which is used to record the outcome of calls when the CircuitBreaker is closed.
|
Resilience4jConfigurationDefinition |
slidingWindowType(String slidingWindowType)
Configures the type of the sliding window which is used to record the outcome of calls when the CircuitBreaker is closed.
|
Resilience4jConfigurationDefinition |
slowCallDurationThreshold(Integer slowCallDurationThreshold)
Configures the duration threshold (seconds) above which calls are considered as slow and increase the slow calls percentage.
|
Resilience4jConfigurationDefinition |
slowCallRateThreshold(Float slowCallRateThreshold)
Configures a threshold in percentage.
|
Resilience4jConfigurationDefinition |
timeoutCancelRunningFuture(Boolean timeoutCancelRunningFuture)
Configures whether cancel is called on the running future.
|
Resilience4jConfigurationDefinition |
timeoutDuration(Integer timeoutDuration)
Configures the thread execution timeout (millis).
|
Resilience4jConfigurationDefinition |
timeoutEnabled(Boolean timeoutEnabled)
Whether timeout is enabled or not on the circuit breaker.
|
Resilience4jConfigurationDefinition |
timeoutExecutorServiceRef(String executorServiceRef)
References to a custom thread pool to use when timeout is enabled (uses
ForkJoinPool.commonPool() by default) |
Resilience4jConfigurationDefinition |
waitDurationInOpenState(Integer waitDurationInOpenState)
Configures the wait duration (in seconds) which specifies how long the CircuitBreaker should stay open, before it switches to half open.
|
Resilience4jConfigurationDefinition |
writableStackTraceEnabled(Boolean writableStackTraceEnabled)
Enables writable stack traces.
|
getAutomaticTransitionFromOpenToHalfOpenEnabled, getBulkheadEnabled, getBulkheadMaxConcurrentCalls, getBulkheadMaxWaitDuration, getCircuitBreakerRef, getConfigRef, getFailureRateThreshold, getMinimumNumberOfCalls, getPermittedNumberOfCallsInHalfOpenState, getSlidingWindowSize, getSlidingWindowType, getSlowCallDurationThreshold, getSlowCallRateThreshold, getTimeoutCancelRunningFuture, getTimeoutDuration, getTimeoutEnabled, getTimeoutExecutorServiceRef, getWaitDurationInOpenState, getWritableStackTraceEnabled, setAutomaticTransitionFromOpenToHalfOpenEnabled, setBulkheadEnabled, setBulkheadMaxConcurrentCalls, setBulkheadMaxWaitDuration, setCircuitBreakerRef, setConfigRef, setFailureRateThreshold, setMinimumNumberOfCalls, setPermittedNumberOfCallsInHalfOpenState, setSlidingWindowSize, setSlidingWindowType, setSlowCallDurationThreshold, setSlowCallRateThreshold, setTimeoutCancelRunningFuture, setTimeoutDuration, setTimeoutEnabled, setTimeoutExecutorServiceRef, setWaitDurationInOpenState, setWritableStackTraceEnabledgetId, setIdpublic Resilience4jConfigurationDefinition()
public Resilience4jConfigurationDefinition(CircuitBreakerDefinition parent)
public Resilience4jConfigurationDefinition circuitBreakerRef(String circuitBreakerRef)
public Resilience4jConfigurationDefinition configRef(String ref)
public Resilience4jConfigurationDefinition failureRateThreshold(Float failureRateThreshold)
The threshold must be greater than 0 and not greater than 100. Default value is 50 percentage.
public Resilience4jConfigurationDefinition permittedNumberOfCallsInHalfOpenState(Integer permittedNumberOfCallsInHalfOpenState)
The size must be greater than 0. Default size is 10.
public Resilience4jConfigurationDefinition slidingWindowSize(Integer slidingWindowSize)
slidingWindowSize configures the size of the sliding window. Sliding window can either be count-based or time-based.
If slidingWindowType is COUNT_BASED, the last slidingWindowSize calls are recorded and aggregated.
If slidingWindowType is TIME_BASED, the calls of the last slidingWindowSize seconds are recorded and aggregated.
The slidingWindowSize must be greater than 0.
The minimumNumberOfCalls must be greater than 0.
If the slidingWindowType is COUNT_BASED, the minimumNumberOfCalls cannot be greater than slidingWindowSize.
If the slidingWindowType is TIME_BASED, you can pick whatever you want.
Default slidingWindowSize is 100.
public Resilience4jConfigurationDefinition slidingWindowType(String slidingWindowType)
slidingWindowType is COUNT_BASED, the last slidingWindowSize calls are recorded and aggregated.
If slidingWindowType is TIME_BASED, the calls of the last slidingWindowSize seconds are recorded and aggregated.
Default slidingWindowType is COUNT_BASED.public Resilience4jConfigurationDefinition minimumNumberOfCalls(Integer minimumNumberOfCalls)
minimumNumberOfCalls is 10, then at least 10 calls must be recorded, before the failure rate can be calculated.
If only 9 calls have been recorded the CircuitBreaker will not transition to open even if all 9 calls have failed.
Default minimumNumberOfCalls is 100public Resilience4jConfigurationDefinition writableStackTraceEnabled(Boolean writableStackTraceEnabled)
public Resilience4jConfigurationDefinition waitDurationInOpenState(Integer waitDurationInOpenState)
public Resilience4jConfigurationDefinition automaticTransitionFromOpenToHalfOpenEnabled(Boolean automaticTransitionFromOpenToHalfOpenEnabled)
public Resilience4jConfigurationDefinition slowCallRateThreshold(Float slowCallRateThreshold)
The threshold must be greater than 0 and not greater than 100. Default value is 100 percentage which means that all recorded calls must be slower than slowCallDurationThreshold.
public Resilience4jConfigurationDefinition slowCallDurationThreshold(Integer slowCallDurationThreshold)
public Resilience4jConfigurationDefinition bulkheadEnabled(Boolean bulkheadEnabled)
public Resilience4jConfigurationDefinition bulkheadMaxConcurrentCalls(Integer bulkheadMaxConcurrentCalls)
public Resilience4jConfigurationDefinition bulkheadMaxWaitDuration(Integer bulkheadMaxWaitDuration)
Note: for threads running on an event-loop or equivalent (rx computation pool, etc), setting maxWaitDuration to 0 is highly recommended. Blocking an event-loop thread will most likely have a negative effect on application throughput.
public Resilience4jConfigurationDefinition timeoutEnabled(Boolean timeoutEnabled)
public Resilience4jConfigurationDefinition timeoutExecutorServiceRef(String executorServiceRef)
ForkJoinPool.commonPool() by default)public Resilience4jConfigurationDefinition timeoutDuration(Integer timeoutDuration)
public Resilience4jConfigurationDefinition timeoutCancelRunningFuture(Boolean timeoutCancelRunningFuture)
public CircuitBreakerDefinition end()
Apache Camel