public class CircuitBreakerConfiguration extends Object
A CircuitBreakerConfiguration
configures a circuit breaker
Setting an invocation response timeout lower that the slow call threshold will bypass the intended effect of the circuit breaker
Modifier and Type | Class and Description |
---|---|
static class |
CircuitBreakerConfiguration.CircuitBreakerConfigurationBuilder |
Modifier and Type | Field and Description |
---|---|
static int |
BAD_GATEWAY |
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 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 |
static int |
GATEWAY_TIMEOUT |
static int |
INTERNAL_SERVER_ERROR |
static int |
NUMBER_OF_RECORDED_HISTORY_RESPONSES |
static int |
SERVICE_UNAVAILABLE |
static int |
TOO_MANY_REQUESTS |
Modifier | Constructor and Description |
---|---|
|
CircuitBreakerConfiguration() |
protected |
CircuitBreakerConfiguration(int failureRateThreshold,
int slowCallRateThreshold,
Duration waitDurationInOpenState,
int permittedNumberOfCallsInHalfOpenState,
int minimumNumberOfCalls,
int slidingWindowSize,
Duration slowCallDurationThreshold,
boolean writableStackTraceEnabled,
Set<Integer> recordHttpStatuses,
List<Class<? extends RuntimeException>> recordExceptions,
boolean recordProcessingFailures) |
protected |
CircuitBreakerConfiguration(int failureRateThreshold,
int slowCallRateThreshold,
Duration waitDurationInOpenState,
int permittedNumberOfCallsInHalfOpenState,
int minimumNumberOfCalls,
int slidingWindowSize,
Duration slowCallDurationThreshold,
boolean writableStackTraceEnabled,
Set<Integer> recordHttpStatuses,
List<Class<? extends RuntimeException>> recordExceptions,
boolean recordProcessingFailures,
int numberOfRecordedHistoryResponses)
Use
builder() instead. |
Modifier and Type | Method and Description |
---|---|
static CircuitBreakerConfiguration.CircuitBreakerConfigurationBuilder |
builder() |
int |
getFailureRateThreshold() |
int |
getMinimumNumberOfCalls() |
int |
getNumberOfRecordedHistoryResponses() |
int |
getPermittedNumberOfCallsInHalfOpenState() |
List<Class<? extends RuntimeException>> |
getRecordExceptions() |
Set<Integer> |
getRecordHttpStatuses() |
int |
getSlidingWindowSize() |
Duration |
getSlowCallDurationThreshold() |
int |
getSlowCallRateThreshold() |
Duration |
getWaitDurationInOpenState() |
boolean |
isRecordProcessingFailures() |
boolean |
isWritableStackTraceEnabled() |
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 boolean DEFAULT_WRITABLE_STACK_TRACE_ENABLED
public static final int NUMBER_OF_RECORDED_HISTORY_RESPONSES
public static final int TOO_MANY_REQUESTS
public static final int INTERNAL_SERVER_ERROR
public static final int SERVICE_UNAVAILABLE
public static final int BAD_GATEWAY
public static final int GATEWAY_TIMEOUT
protected CircuitBreakerConfiguration(int failureRateThreshold, int slowCallRateThreshold, Duration waitDurationInOpenState, int permittedNumberOfCallsInHalfOpenState, int minimumNumberOfCalls, int slidingWindowSize, Duration slowCallDurationThreshold, boolean writableStackTraceEnabled, Set<Integer> recordHttpStatuses, List<Class<? extends RuntimeException>> recordExceptions, boolean recordProcessingFailures)
@ConstructorProperties(value={"failureRateThreshold","slowCallRateThreshold","waitDurationInOpenState","permittedNumberOfCallsInHalfOpenState","minimumNumberOfCalls","slidingWindowSize","slowCallDurationThreshold","writableStackTraceEnabled","recordHttpStatuses","recordExceptions","numberOfRecordedHistoryResponses"}) protected CircuitBreakerConfiguration(int failureRateThreshold, int slowCallRateThreshold, Duration waitDurationInOpenState, int permittedNumberOfCallsInHalfOpenState, int minimumNumberOfCalls, int slidingWindowSize, Duration slowCallDurationThreshold, boolean writableStackTraceEnabled, Set<Integer> recordHttpStatuses, List<Class<? extends RuntimeException>> recordExceptions, boolean recordProcessingFailures, int numberOfRecordedHistoryResponses)
Use builder()
instead.
failureRateThreshold
- slowCallRateThreshold
- waitDurationInOpenState
- permittedNumberOfCallsInHalfOpenState
- minimumNumberOfCalls
- slidingWindowSize
- slowCallDurationThreshold
- writableStackTraceEnabled
- recordHttpStatuses
- recordExceptions
- recordProcessingFailures
- numberOfRecordedHistoryResponses
- public CircuitBreakerConfiguration()
public static CircuitBreakerConfiguration.CircuitBreakerConfigurationBuilder builder()
public int getFailureRateThreshold()
public int getSlowCallRateThreshold()
public Duration getWaitDurationInOpenState()
public int getPermittedNumberOfCallsInHalfOpenState()
public int getMinimumNumberOfCalls()
public int getSlidingWindowSize()
public Duration getSlowCallDurationThreshold()
public boolean isWritableStackTraceEnabled()
public int getNumberOfRecordedHistoryResponses()
public List<Class<? extends RuntimeException>> getRecordExceptions()
public boolean isRecordProcessingFailures()
Copyright © 2016–2024. All rights reserved.