R
- result typepublic class CircuitBreakerConfig<R> extends DelayablePolicyConfig<R>
CircuitBreaker
.
This class is threadsafe.
CircuitBreakerBuilder
Modifier and Type | Method and Description |
---|---|
EventListener<CircuitBreakerStateChangedEvent> |
getCloseListener()
Returns the close event listener.
|
Duration |
getDelay()
Returns the delay before allowing another execution on the circuit.
|
int |
getFailureExecutionThreshold()
Used with time based thresholding.
|
int |
getFailureRateThreshold()
Used with time based thresholding.
|
int |
getFailureThreshold()
Gets the number of failures that must occur within the
failure
thresholding capacity when in a CLOSED or HALF_OPEN state in order to open the circuit. |
int |
getFailureThresholdingCapacity()
Returns the rolling capacity for storing execution results when performing failure thresholding in the CLOSED or
HALF_OPEN states.
|
Duration |
getFailureThresholdingPeriod()
Used with time based thresholding.
|
EventListener<CircuitBreakerStateChangedEvent> |
getHalfOpenListener()
Returns the half-open event listener.
|
EventListener<CircuitBreakerStateChangedEvent> |
getOpenListener()
Returns the open event listener.
|
int |
getSuccessThreshold()
Gets the number of successes that must occur within the
success
thresholding capacity when in a HALF_OPEN state in order to open the circuit. |
int |
getSuccessThresholdingCapacity()
Returns the rolling capacity for storing execution results when performing success thresholding in the HALF_OPEN
state.
|
getDelayException, getDelayFn, getDelayResult
getFailureConditions, isExceptionsChecked
getFailureListener, getSuccessListener
public Duration getDelay()
getDelay
in class DelayablePolicyConfig<R>
CircuitBreakerBuilder.withDelay(Duration)
,
CircuitBreaker.getRemainingDelay()
public int getFailureThreshold()
failure
thresholding capacity
when in a CLOSED or HALF_OPEN state in order to open the circuit. Returns 1
by
default.public int getFailureThresholdingCapacity()
1
by default. Only the most recent executions that fit within this capacity contribute to
thresholding decisions.public int getFailureRateThreshold()
0
if failure rate thresholding is not
configured.public Duration getFailureThresholdingPeriod()
null
if time based failure thresholding is not configured. Only the most
recent executions that occurred within this rolling time period contribute to thresholding decisions.public int getFailureExecutionThreshold()
failure rate thresholding
this also determines the minimum number of executions that must be recorded in
the HALF_OPEN state. Returns 0
by default.public int getSuccessThreshold()
success
thresholding capacity
when in a HALF_OPEN state in order to open the circuit. Returns 0
by default, in
which case the failure threshold
is used instead.public int getSuccessThresholdingCapacity()
public EventListener<CircuitBreakerStateChangedEvent> getOpenListener()
public EventListener<CircuitBreakerStateChangedEvent> getHalfOpenListener()
public EventListener<CircuitBreakerStateChangedEvent> getCloseListener()
Copyright © 2022. All rights reserved.