public class CircuitBreakerConfiguration extends Object
A CircuitBreakerConfiguration
configures a JaxRsCircuitBreakerImpl
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 Class<javax.ws.rs.InternalServerErrorException> |
INTERNAL_SERVER_ERROR_EXCEPTION_CLASS |
static Class<javax.ws.rs.ProcessingException> |
PROCESSING_EXCEPTION_CLASS |
static int |
SERVICE_UNAVAILABLE |
static Class<javax.ws.rs.ServiceUnavailableException> |
SERVICE_UNAVAILABLE_EXCEPTION_CLASS |
static int |
TOO_MANY_REQUESTS |
Constructor and Description |
---|
CircuitBreakerConfiguration() |
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) |
Modifier and Type | Method and Description |
---|---|
static CircuitBreakerConfiguration.CircuitBreakerConfigurationBuilder |
builder() |
int |
getFailureRateThreshold() |
int |
getMinimumNumberOfCalls() |
int |
getPermittedNumberOfCallsInHalfOpenState() |
List<Class<? extends RuntimeException>> |
getRecordExceptions() |
Set<Integer> |
getRecordHttpStatuses() |
int |
getSlidingWindowSize() |
Duration |
getSlowCallDurationThreshold() |
int |
getSlowCallRateThreshold() |
Duration |
getWaitDurationInOpenState() |
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 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
public static final Class<javax.ws.rs.ProcessingException> PROCESSING_EXCEPTION_CLASS
public static final Class<javax.ws.rs.ServiceUnavailableException> SERVICE_UNAVAILABLE_EXCEPTION_CLASS
public static final Class<javax.ws.rs.InternalServerErrorException> INTERNAL_SERVER_ERROR_EXCEPTION_CLASS
@ConstructorProperties(value={"failureRateThreshold","slowCallRateThreshold","waitDurationInOpenState","permittedNumberOfCallsInHalfOpenState","minimumNumberOfCalls","slidingWindowSize","slowCallDurationThreshold","writableStackTraceEnabled","recordHttpStatuses","recordExceptions"}) public 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)
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 List<Class<? extends RuntimeException>> getRecordExceptions()
Copyright © 2016–2022. All rights reserved.