Interface CircuitBreaker


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

      • 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.