Class CircuitBreakerOpenException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.teceli.resiliencia.core.api.ResilientException
io.github.teceli.resiliencia.patterns.circuitbreaker.CircuitBreakerOpenException
- All Implemented Interfaces:
Serializable
Thrown when a call is rejected because the circuit breaker will not let it through: either
the circuit is Open, or it is HalfOpen and every permitted test call has already been issued.
openSince and remainingWait are only present in the Open case — a HalfOpen
rejection has nothing equivalent to report, since the circuit is already attempting test calls.
The name carried by this exception is the circuit breaker's own name, which must be a
static, compile-time-known string — never request-derived or tenant-derived. It is used as a
cardinality-bounded key/tag in metrics and logging; unbounded distinct names would cause
unbounded memory growth in metrics backends.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic CircuitBreakerOpenExceptionforHalfOpenState(String name) A rejection while the circuit is HalfOpen, because every permitted test call has already been issued.static CircuitBreakerOpenExceptionforOpenState(String name, Instant openSince, Duration remainingWait) A rejection while the circuit is Open, carrying when it opened and how much longer it will stay Open before a HalfOpen test call is attempted.name()Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
forOpenState
public static CircuitBreakerOpenException forOpenState(String name, Instant openSince, Duration remainingWait) A rejection while the circuit is Open, carrying when it opened and how much longer it will stay Open before a HalfOpen test call is attempted. -
forHalfOpenState
A rejection while the circuit is HalfOpen, because every permitted test call has already been issued. -
name
-
openSince
-
remainingWait
-