public class CircuitBreakerConfig
extends java.lang.Object
CircuitBreakerConfig
configures a CircuitBreaker
Modifier and Type | Class and Description |
---|---|
static class |
CircuitBreakerConfig.Builder |
static class |
CircuitBreakerConfig.SlidingWindowType |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_FAILURE_RATE_THRESHOLD |
static int |
DEFAULT_MINIMUM_NUMBER_OF_CALLS |
static int |
DEFAULT_PERMITTED_CALLS_IN_HALF_OPEN_STATE |
static int |
DEFAULT_SLIDING_WINDOW_SIZE |
static CircuitBreakerConfig.SlidingWindowType |
DEFAULT_SLIDING_WINDOW_TYPE |
static int |
DEFAULT_SLOW_CALL_DURATION_THRESHOLD |
static int |
DEFAULT_SLOW_CALL_RATE_THRESHOLD |
static int |
DEFAULT_WAIT_DURATION_IN_OPEN_STATE |
static boolean |
DEFAULT_WRITABLE_STACK_TRACE_ENABLED |
Modifier and Type | Method and Description |
---|---|
static CircuitBreakerConfig.Builder |
custom()
Returns a builder to create a custom CircuitBreakerConfig.
|
static CircuitBreakerConfig.Builder |
from(CircuitBreakerConfig baseConfig)
Returns a builder to create a custom CircuitBreakerConfig based on another
CircuitBreakerConfig.
|
float |
getFailureRateThreshold() |
java.util.function.Predicate<java.lang.Throwable> |
getIgnoreExceptionPredicate() |
int |
getMinimumNumberOfCalls() |
int |
getPermittedNumberOfCallsInHalfOpenState() |
java.util.function.Predicate<java.lang.Throwable> |
getRecordExceptionPredicate() |
int |
getSlidingWindowSize() |
CircuitBreakerConfig.SlidingWindowType |
getSlidingWindowType() |
java.time.Duration |
getSlowCallDurationThreshold() |
float |
getSlowCallRateThreshold() |
java.time.Duration |
getWaitDurationInOpenState()
Deprecated.
since 1.2.0 You should use
getWaitIntervalFunctionInOpenState() instead. |
io.github.resilience4j.core.IntervalFunction |
getWaitIntervalFunctionInOpenState()
Returns an interval function which controls how long the CircuitBreaker should stay open,
before it switches to half open.
|
boolean |
isAutomaticTransitionFromOpenToHalfOpenEnabled() |
boolean |
isWritableStackTraceEnabled() |
static CircuitBreakerConfig |
ofDefaults()
Creates a default CircuitBreaker configuration.
|
public static final int DEFAULT_FAILURE_RATE_THRESHOLD
public static final int DEFAULT_SLOW_CALL_RATE_THRESHOLD
public static final int DEFAULT_WAIT_DURATION_IN_OPEN_STATE
public static final int DEFAULT_PERMITTED_CALLS_IN_HALF_OPEN_STATE
public static final int DEFAULT_MINIMUM_NUMBER_OF_CALLS
public static final int DEFAULT_SLIDING_WINDOW_SIZE
public static final int DEFAULT_SLOW_CALL_DURATION_THRESHOLD
public static final CircuitBreakerConfig.SlidingWindowType DEFAULT_SLIDING_WINDOW_TYPE
public static final boolean DEFAULT_WRITABLE_STACK_TRACE_ENABLED
public static CircuitBreakerConfig.Builder custom()
CircuitBreakerConfig.Builder
public static CircuitBreakerConfig.Builder from(CircuitBreakerConfig baseConfig)
CircuitBreakerConfig.Builder
public static CircuitBreakerConfig ofDefaults()
public float getFailureRateThreshold()
@Deprecated public java.time.Duration getWaitDurationInOpenState()
getWaitIntervalFunctionInOpenState()
instead.public io.github.resilience4j.core.IntervalFunction getWaitIntervalFunctionInOpenState()
public int getSlidingWindowSize()
public java.util.function.Predicate<java.lang.Throwable> getRecordExceptionPredicate()
public java.util.function.Predicate<java.lang.Throwable> getIgnoreExceptionPredicate()
public boolean isAutomaticTransitionFromOpenToHalfOpenEnabled()
public int getMinimumNumberOfCalls()
public boolean isWritableStackTraceEnabled()
public int getPermittedNumberOfCallsInHalfOpenState()
public CircuitBreakerConfig.SlidingWindowType getSlidingWindowType()
public float getSlowCallRateThreshold()
public java.time.Duration getSlowCallDurationThreshold()