public static final class ResilienceConfiguration.CircuitBreakerConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CLOSED_BUFFER_SIZE
The default size of the buffer in CLOSED state.
|
static float |
DEFAULT_FAILURE_RATE_THRESHOLD
The default threshold at which to transition to the OPEN state.
|
static int |
DEFAULT_HALF_OPEN_BUFFER_SIZE
The default size of the buffer in HALF OPEN state.
|
static Duration |
DEFAULT_WAIT_DURATION
The default duration to wait in OPEN state before transitioning into the HALF OPEN state.
|
Modifier and Type | Method and Description |
---|---|
int |
closedBufferSize()
The number of latest attempts in the CLOSED state to apply the threshold to.
|
ResilienceConfiguration.CircuitBreakerConfiguration |
closedBufferSize(int closedBufferSize)
The number of latest attempts in the CLOSED state to apply the threshold to.
|
static ResilienceConfiguration.CircuitBreakerConfiguration |
disabled()
Creates a disabled
CircuitBreakerConfiguration . |
boolean |
equals(Object o) |
float |
failureRateThreshold()
The failure rate threshold (as percentage within [0, 100]).
|
ResilienceConfiguration.CircuitBreakerConfiguration |
failureRateThreshold(float failureRateThreshold)
The failure rate threshold (as percentage within [0, 100]).
|
int |
halfOpenBufferSize()
The number of latest attempts in the HALF OPEN state that must succeed in order to transition to the
CLOSED state.
|
ResilienceConfiguration.CircuitBreakerConfiguration |
halfOpenBufferSize(int halfOpenBufferSize)
The number of latest attempts in the HALF OPEN state that must succeed in order to transition to the
CLOSED state.
|
int |
hashCode() |
boolean |
isEnabled()
Get the status indicator for the CircuitBreaker.
|
static ResilienceConfiguration.CircuitBreakerConfiguration |
of() |
@NonNull Duration |
waitDuration()
The wait duration in the OPEN state before transitioning into the HALF OPEN state.
|
ResilienceConfiguration.CircuitBreakerConfiguration |
waitDuration(@NonNull Duration waitDuration)
The wait duration in the OPEN state before transitioning into the HALF OPEN state.
|
public static final float DEFAULT_FAILURE_RATE_THRESHOLD
public static final int DEFAULT_CLOSED_BUFFER_SIZE
public static final int DEFAULT_HALF_OPEN_BUFFER_SIZE
public static final Duration DEFAULT_WAIT_DURATION
public boolean isEnabled()
@Nonnull public static ResilienceConfiguration.CircuitBreakerConfiguration disabled()
CircuitBreakerConfiguration
.public static ResilienceConfiguration.CircuitBreakerConfiguration of()
public float failureRateThreshold()
@NonNull public @NonNull Duration waitDuration()
public int closedBufferSize()
closedRingBufferSize
calls exceeds the threshold, the circuit breaker will block further
calls (OPEN state). Be aware that this is the minimum number of attempts that must have occurred
before the circuit breaker can take effect.public int halfOpenBufferSize()
public ResilienceConfiguration.CircuitBreakerConfiguration failureRateThreshold(float failureRateThreshold)
public ResilienceConfiguration.CircuitBreakerConfiguration waitDuration(@NonNull @NonNull Duration waitDuration)
public ResilienceConfiguration.CircuitBreakerConfiguration closedBufferSize(int closedBufferSize)
closedRingBufferSize
calls exceeds the threshold, the circuit breaker will block further
calls (OPEN state). Be aware that this is the minimum number of attempts that must have occurred
before the circuit breaker can take effect.public ResilienceConfiguration.CircuitBreakerConfiguration halfOpenBufferSize(int halfOpenBufferSize)
Copyright © 2019 SAP SE. All rights reserved.