Interface CircuitBreaker


public interface CircuitBreaker
A circuit breaker, which tracks the number of success/failure requests and detects a remote service failure.
  • Method Details

    • builder

      static CircuitBreakerBuilder builder()
      Returns a new CircuitBreakerBuilder.
    • builder

      static CircuitBreakerBuilder builder(String name)
      Returns a new CircuitBreakerBuilder that has the specified name.
      Parameters:
      name - the name of the circuit breaker.
    • of

      static CircuitBreaker of(String name)
      Creates a new CircuitBreaker that has the specified name and the default configurations.
      Parameters:
      name - the name of the circuit breaker
    • ofDefaultName

      static CircuitBreaker ofDefaultName()
      Creates a new CircuitBreaker that has a default name and the default configurations.
    • name

      String name()
      Returns the name of the circuit breaker.
    • onSuccess

      void onSuccess()
      Reports a remote invocation success.
    • onFailure

      void onFailure()
      Reports a remote invocation failure.
    • canRequest

      boolean canRequest()
      Decides whether a request should be sent or failed depending on the current circuit state.