Package com.guinetik.rr.http
Class HttpConstants.CircuitBreaker
- java.lang.Object
-
- com.guinetik.rr.http.HttpConstants.CircuitBreaker
-
- Enclosing class:
- HttpConstants
public static final class HttpConstants.CircuitBreaker extends Object
CircuitBreaker-related constants
-
-
Field Summary
Fields Modifier and Type Field Description static StringCIRCUIT_BREAKER_ENABLEDConfiguration option key for enabling/disabling circuit breakerstatic StringCIRCUIT_BREAKER_FAILURE_POLICYConfiguration option key for setting failure policystatic StringCIRCUIT_BREAKER_FAILURE_THRESHOLDConfiguration option key for setting failure thresholdstatic StringCIRCUIT_BREAKER_POLICY_SERVER_ONLYConfiguration option value for server-errors-only failure policystatic StringCIRCUIT_BREAKER_RESET_TIMEOUT_MSConfiguration option key for setting reset timeoutstatic StringCIRCUIT_OPENError message when the circuit is openstatic longDEFAULT_FAILURE_DECAY_TIME_MSDefault time in milliseconds before failure count begins to decay (1 minute)static intDEFAULT_FAILURE_THRESHOLDDefault number of failures before opening the circuitstatic longDEFAULT_RESET_TIMEOUT_MSDefault timeout in milliseconds before attempting to half-open the circuit (30 seconds)static StringLOG_CIRCUIT_CLOSEDLog message when circuit is closedstatic StringLOG_CIRCUIT_HALF_OPENLog message when circuit moves to half-open statestatic StringLOG_CIRCUIT_OPENEDLog message template when circuit is openedstatic StringLOG_DECAY_RESETLog message when failure count is reset due to decay timeoutstatic StringLOG_HALF_OPEN_TEST_IN_PROGRESSLog message when a request is rejected during HALF_OPEN because another test is in progressstatic StringLOG_TEST_FAILEDLog message when test request failsstatic StringSTATUS_CLOSEDCircuit breaker status: closed (allowing requests)static StringSTATUS_HALF_OPENCircuit breaker status: half-open (allowing test requests)static StringSTATUS_OPENCircuit breaker status: open (not allowing requests)
-
Constructor Summary
Constructors Constructor Description CircuitBreaker()
-
-
-
Field Detail
-
DEFAULT_FAILURE_THRESHOLD
public static final int DEFAULT_FAILURE_THRESHOLD
Default number of failures before opening the circuit- See Also:
- Constant Field Values
-
DEFAULT_RESET_TIMEOUT_MS
public static final long DEFAULT_RESET_TIMEOUT_MS
Default timeout in milliseconds before attempting to half-open the circuit (30 seconds)- See Also:
- Constant Field Values
-
DEFAULT_FAILURE_DECAY_TIME_MS
public static final long DEFAULT_FAILURE_DECAY_TIME_MS
Default time in milliseconds before failure count begins to decay (1 minute)- See Also:
- Constant Field Values
-
CIRCUIT_OPEN
public static final String CIRCUIT_OPEN
Error message when the circuit is open- See Also:
- Constant Field Values
-
LOG_CIRCUIT_HALF_OPEN
public static final String LOG_CIRCUIT_HALF_OPEN
Log message when circuit moves to half-open state- See Also:
- Constant Field Values
-
LOG_CIRCUIT_CLOSED
public static final String LOG_CIRCUIT_CLOSED
Log message when circuit is closed- See Also:
- Constant Field Values
-
LOG_TEST_FAILED
public static final String LOG_TEST_FAILED
Log message when test request fails- See Also:
- Constant Field Values
-
LOG_CIRCUIT_OPENED
public static final String LOG_CIRCUIT_OPENED
Log message template when circuit is opened- See Also:
- Constant Field Values
-
LOG_DECAY_RESET
public static final String LOG_DECAY_RESET
Log message when failure count is reset due to decay timeout- See Also:
- Constant Field Values
-
LOG_HALF_OPEN_TEST_IN_PROGRESS
public static final String LOG_HALF_OPEN_TEST_IN_PROGRESS
Log message when a request is rejected during HALF_OPEN because another test is in progress- See Also:
- Constant Field Values
-
STATUS_OPEN
public static final String STATUS_OPEN
Circuit breaker status: open (not allowing requests)- See Also:
- Constant Field Values
-
STATUS_CLOSED
public static final String STATUS_CLOSED
Circuit breaker status: closed (allowing requests)- See Also:
- Constant Field Values
-
STATUS_HALF_OPEN
public static final String STATUS_HALF_OPEN
Circuit breaker status: half-open (allowing test requests)- See Also:
- Constant Field Values
-
CIRCUIT_BREAKER_ENABLED
public static final String CIRCUIT_BREAKER_ENABLED
Configuration option key for enabling/disabling circuit breaker- See Also:
- Constant Field Values
-
CIRCUIT_BREAKER_FAILURE_THRESHOLD
public static final String CIRCUIT_BREAKER_FAILURE_THRESHOLD
Configuration option key for setting failure threshold- See Also:
- Constant Field Values
-
CIRCUIT_BREAKER_RESET_TIMEOUT_MS
public static final String CIRCUIT_BREAKER_RESET_TIMEOUT_MS
Configuration option key for setting reset timeout- See Also:
- Constant Field Values
-
CIRCUIT_BREAKER_FAILURE_POLICY
public static final String CIRCUIT_BREAKER_FAILURE_POLICY
Configuration option key for setting failure policy- See Also:
- Constant Field Values
-
CIRCUIT_BREAKER_POLICY_SERVER_ONLY
public static final String CIRCUIT_BREAKER_POLICY_SERVER_ONLY
Configuration option value for server-errors-only failure policy- See Also:
- Constant Field Values
-
-