Interface CircuitBreakerListener
- All Known Implementing Classes:
CircuitBreakerListenerAdapter
,MetricCollectingCircuitBreakerListener
public interface CircuitBreakerListener
The listener interface for receiving
CircuitBreaker
events.-
Method Summary
Modifier and Type Method Description static CircuitBreakerListener
metricCollecting(MeterRegistry registry)
Returns a newCircuitBreakerListener
that collects metric with the specifiedMeterRegistry
.static CircuitBreakerListener
metricCollecting(MeterRegistry registry, String name)
Returns a newCircuitBreakerListener
that collects metric with the specifiedMeterRegistry
andMeter
name.void
onEventCountUpdated(String circuitBreakerName, EventCount eventCount)
Invoked when the circuit breaker's internalEventCount
is updated.default void
onInitialized(String circuitBreakerName, CircuitState initialState)
Invoked when the circuit breaker is initialized.void
onRequestRejected(String circuitBreakerName)
Invoked when the circuit breaker rejects a request.void
onStateChanged(String circuitBreakerName, CircuitState state)
Invoked when the circuit state is changed.
-
Method Details
-
metricCollecting
Returns a newCircuitBreakerListener
that collects metric with the specifiedMeterRegistry
. -
metricCollecting
Returns a newCircuitBreakerListener
that collects metric with the specifiedMeterRegistry
andMeter
name. -
onInitialized
Invoked when the circuit breaker is initialized.- Throws:
Exception
-
onStateChanged
Invoked when the circuit state is changed.- Throws:
Exception
-
onEventCountUpdated
Invoked when the circuit breaker's internalEventCount
is updated.- Throws:
Exception
-
onRequestRejected
Invoked when the circuit breaker rejects a request.- Throws:
Exception
-