public class Resilience4jConfigurationCommon extends IdentifiedType
Constructor and Description |
---|
Resilience4jConfigurationCommon() |
Modifier and Type | Method and Description |
---|---|
String |
getAutomaticTransitionFromOpenToHalfOpenEnabled() |
String |
getBulkheadEnabled() |
String |
getBulkheadMaxConcurrentCalls() |
String |
getBulkheadMaxWaitDuration() |
String |
getCircuitBreakerRef() |
String |
getConfigRef() |
String |
getFailureRateThreshold() |
String |
getMinimumNumberOfCalls() |
String |
getPermittedNumberOfCallsInHalfOpenState() |
String |
getSlidingWindowSize() |
String |
getSlidingWindowType() |
String |
getSlowCallDurationThreshold() |
String |
getSlowCallRateThreshold() |
String |
getTimeoutCancelRunningFuture() |
String |
getTimeoutDuration() |
String |
getTimeoutEnabled() |
String |
getTimeoutExecutorServiceRef() |
String |
getWaitDurationInOpenState() |
String |
getWritableStackTraceEnabled() |
void |
setAutomaticTransitionFromOpenToHalfOpenEnabled(String automaticTransitionFromOpenToHalfOpenEnabled)
Enables automatic transition from OPEN to HALF_OPEN state once the waitDurationInOpenState has passed.
|
void |
setBulkheadEnabled(String bulkheadEnabled)
Whether bulkhead is enabled or not on the circuit breaker.
|
void |
setBulkheadMaxConcurrentCalls(String bulkheadMaxConcurrentCalls)
Configures the max amount of concurrent calls the bulkhead will support.
|
void |
setBulkheadMaxWaitDuration(String bulkheadMaxWaitDuration)
Configures a maximum amount of time which the calling thread will wait to enter the bulkhead.
|
void |
setCircuitBreakerRef(String circuitBreakerRef)
Refers to an existing io.github.resilience4j.circuitbreaker.CircuitBreaker instance to lookup and use from the
registry.
|
void |
setConfigRef(String configRef)
Refers to an existing io.github.resilience4j.circuitbreaker.CircuitBreakerConfig instance to lookup and use from
the registry.
|
void |
setFailureRateThreshold(String failureRateThreshold)
Configures the failure rate threshold in percentage.
|
void |
setMinimumNumberOfCalls(String minimumNumberOfCalls)
Configures the minimum number of calls which are required (per sliding window period) before the CircuitBreaker
can calculate the error rate.
|
void |
setPermittedNumberOfCallsInHalfOpenState(String permittedNumberOfCallsInHalfOpenState)
Configures the number of permitted calls when the CircuitBreaker is half open.
|
void |
setSlidingWindowSize(String slidingWindowSize)
Configures the size of the sliding window which is used to record the outcome of calls when the CircuitBreaker is
closed.
|
void |
setSlidingWindowType(String slidingWindowType)
Configures the type of the sliding window which is used to record the outcome of calls when the CircuitBreaker is
closed.
|
void |
setSlowCallDurationThreshold(String slowCallDurationThreshold)
Configures the duration threshold (seconds) above which calls are considered as slow and increase the slow calls
percentage.
|
void |
setSlowCallRateThreshold(String slowCallRateThreshold)
Configures a threshold in percentage.
|
void |
setTimeoutCancelRunningFuture(String timeoutCancelRunningFuture)
Configures whether cancel is called on the running future.
|
void |
setTimeoutDuration(String timeoutDuration)
Configures the thread execution timeout.
|
void |
setTimeoutEnabled(String timeoutEnabled)
Whether timeout is enabled or not on the circuit breaker.
|
void |
setTimeoutExecutorServiceRef(String timeoutExecutorServiceRef)
References to a custom thread pool to use when timeout is enabled (uses
ForkJoinPool.commonPool() by
default) |
void |
setWaitDurationInOpenState(String waitDurationInOpenState)
Configures the wait duration (in seconds) which specifies how long the CircuitBreaker should stay open, before it
switches to half open.
|
void |
setWritableStackTraceEnabled(String writableStackTraceEnabled)
Enables writable stack traces.
|
getId, setId
public String getCircuitBreakerRef()
public void setCircuitBreakerRef(String circuitBreakerRef)
public String getConfigRef()
public void setConfigRef(String configRef)
public String getFailureRateThreshold()
public void setFailureRateThreshold(String failureRateThreshold)
The threshold must be greater than 0 and not greater than 100. Default value is 50 percentage.
public String getPermittedNumberOfCallsInHalfOpenState()
public void setPermittedNumberOfCallsInHalfOpenState(String permittedNumberOfCallsInHalfOpenState)
The size must be greater than 0. Default size is 10.
public String getSlidingWindowSize()
public void setSlidingWindowSize(String 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 String getSlidingWindowType()
public void setSlidingWindowType(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 String getMinimumNumberOfCalls()
public void setMinimumNumberOfCalls(String 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 String getWritableStackTraceEnabled()
public void setWritableStackTraceEnabled(String writableStackTraceEnabled)
public String getWaitDurationInOpenState()
public void setWaitDurationInOpenState(String waitDurationInOpenState)
public String getAutomaticTransitionFromOpenToHalfOpenEnabled()
public void setAutomaticTransitionFromOpenToHalfOpenEnabled(String automaticTransitionFromOpenToHalfOpenEnabled)
public String getSlowCallRateThreshold()
public void setSlowCallRateThreshold(String 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 String getSlowCallDurationThreshold()
public void setSlowCallDurationThreshold(String slowCallDurationThreshold)
public String getBulkheadEnabled()
public void setBulkheadEnabled(String bulkheadEnabled)
public String getBulkheadMaxConcurrentCalls()
public void setBulkheadMaxConcurrentCalls(String bulkheadMaxConcurrentCalls)
public String getBulkheadMaxWaitDuration()
public void setBulkheadMaxWaitDuration(String 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 String getTimeoutEnabled()
public void setTimeoutEnabled(String timeoutEnabled)
public String getTimeoutExecutorServiceRef()
public void setTimeoutExecutorServiceRef(String timeoutExecutorServiceRef)
ForkJoinPool.commonPool()
by
default)public String getTimeoutDuration()
public void setTimeoutDuration(String timeoutDuration)
public String getTimeoutCancelRunningFuture()
public void setTimeoutCancelRunningFuture(String timeoutCancelRunningFuture)
Apache Camel