Annotation Type CircuitBreaker



  • @Inherited
    @Retention(RUNTIME)
    @Documented
    @InterceptorBinding
    @Target({METHOD,TYPE})
    public @interface CircuitBreaker
    Define the Circuit Breaker policy
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      long delay
      The delay.
      java.time.temporal.ChronoUnit delayUnit  
      java.lang.Class<? extends java.lang.Throwable>[] failOn
      Define the failure criteria
      double failureRatio
      The failure threshold to trigger the circuit to open.
      int requestVolumeThreshold
      The number of consecutive requests in a rolling window that will trip the circuit.
      int successThreshold
      For an open circuit, after the delay period is reached, once the successThreshold is reached, the circuit is back to close again.
    • Element Detail

      • failOn

        java.lang.Class<? extends java.lang.Throwable>[] failOn
        Define the failure criteria
        Returns:
        the failure exception
        Default:
        {java.lang.Throwable.class}
      • delay

        long delay
        The delay. The value must be greater than or equal to 0. 0 means no delay.
        Returns:
        The delay time after the circuit is open
        Default:
        5000L
      • delayUnit

        java.time.temporal.ChronoUnit delayUnit
        Returns:
        The delay unit after the circuit is open
        Default:
        java.time.temporal.ChronoUnit.MILLIS
      • requestVolumeThreshold

        int requestVolumeThreshold
        The number of consecutive requests in a rolling window that will trip the circuit. The value must be greater than or equal to 1.
        Returns:
        the number of the consecutive requests in a rolling window
        Default:
        20
      • failureRatio

        double failureRatio
        The failure threshold to trigger the circuit to open. e.g. if the requestVolumeThreshold is 20 and failureRation is .50, more than 10 failures in 20 consecutive requests will trigger the circuit to open. The value must be between 0 and 1 inclusive.
        Returns:
        The failure threshold to open the circuit
        Default:
        0.5
      • successThreshold

        int successThreshold
        For an open circuit, after the delay period is reached, once the successThreshold is reached, the circuit is back to close again. The value must be greater than or equal to 1.
        Returns:
        The success threshold to fully close the circuit
        Default:
        1