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 |
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 |
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 |
Modifier and Type | Method and Description |
---|---|
static CircuitBreakerConfiguration.CircuitBreakerConfigurationBuilder |
builder() |
int |
getFailureRateThreshold() |
int |
getMinimumNumberOfCalls() |
int |
getPermittedNumberOfCallsInHalfOpenState() |
List<Class<? extends RuntimeException>> |
getRecordExceptions()
List of exceptions for circuitBreaker to consider as failures, we are limiting the list to subclasses of
RuntimeException because all JaxRs exceptions inherit from the RuntimeException
|
Set<Integer> |
getRecordHttpStatuses()
List of default http error codes to record as circuit breaker failure
|
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 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
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 Set<Integer> getRecordHttpStatuses()
List of default http error codes to record as circuit breaker failure
public List<Class<? extends RuntimeException>> getRecordExceptions()
List of exceptions for circuitBreaker to consider as failures, we are limiting the list to subclasses of RuntimeException because all JaxRs exceptions inherit from the RuntimeException
Copyright © 2016–2021. All rights reserved.