Annotation Interface CircuitBreaker


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface CircuitBreaker
Wraps the annotated method in a circuit breaker. After failureThreshold() consecutive failures the breaker opens and fast-fails calls with CrdbException(CircuitOpen) until resetTimeoutMillis() elapses.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    Consecutive failures that trip the breaker into the OPEN state.
    long
    Time the breaker stays OPEN before allowing a HALF_OPEN trial, in millis.
  • Element Details

    • failureThreshold

      int failureThreshold
      Consecutive failures that trip the breaker into the OPEN state.
      Default:
      5
    • resetTimeoutMillis

      long resetTimeoutMillis
      Time the breaker stays OPEN before allowing a HALF_OPEN trial, in millis.
      Default:
      30000L