Class CircuitOpenException

All Implemented Interfaces:
Serializable

public class CircuitOpenException extends EquinixClientException
Thrown when the opt-in CircuitBreaker is open and a request was rejected without being sent to the API. The breaker opens after a configured number of consecutive service failures (5xx responses or transport IOExceptions) and rejects requests until its cooldown elapses, at which point a single probe request is let through.

This is a client-side rejection - no HTTP exchange took place - so it extends EquinixClientException rather than EquinixServiceException. Callers can wait for getRemainingCooldownMillis() before retrying.

Author:
ianjones
See Also:
  • Constructor Details

    • CircuitOpenException

      public CircuitOpenException(String message, long remainingCooldownMillis)
      Creates a rejection for a request refused while the circuit is open.
      Parameters:
      message - a human-readable summary of why the request was rejected
      remainingCooldownMillis - how long (in millis) until the breaker will admit a probe request
  • Method Details

    • getRemainingCooldownMillis

      public long getRemainingCooldownMillis()
      How long until the breaker transitions to half-open and admits a probe request.
      Returns:
      the remaining cooldown in milliseconds (never negative)