Annotation Interface CircuitBreaker


Define the Circuit Breaker policy
  • Optional Element Summary

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

    • failOn

      Class<? extends 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

      ChronoUnit delayUnit
      Returns:
      The delay unit after the circuit is open
      Default:
      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