All Implemented Interfaces:
Serializable

public final class CircuitBreakerOpenException extends ResilientException
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 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

      public static CircuitBreakerOpenException forHalfOpenState(String name)
      A rejection while the circuit is HalfOpen, because every permitted test call has already been issued.
    • name

      public String name()
    • openSince

      public Optional<Instant> openSince()
    • remainingWait

      public Optional<Duration> remainingWait()