Annotation Interface Ft.CircuitBreaker

Enclosing class:
Ft

@Retention(CLASS) @Documented @Intercepted public static @interface Ft.CircuitBreaker
The annotated method (or all methods on annotated type) will have circuit breaker according to the configuration.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<? extends Throwable>[]
    These throwables will be considered failures.
    Delay duration.
    int
    How many failures out of 100 will trigger the circuit to open.
    If named, an attempt will be made to find a named CircuitBreaker instance in service registry.
    Class<? extends Throwable>[]
    These throwables will not be considered failures, all other will.
    int
    How many successful calls will close a half-open circuit.
    int
    Rolling window size used to calculate ratio of failed requests.
  • Element Details

    • name

      String name
      If named, an attempt will be made to find a named CircuitBreaker instance in service registry. If not found, a new circuit breaker will be created based on values on this annotation.
      Returns:
      name of this retry
      Default:
      ""
    • delay

      String delay
      Delay duration. Defaults to PT5S (5 seconds).
      Returns:
      duration to wait before transitioning from open to half-open state
      Default:
      "PT5S"
    • errorRatio

      int errorRatio
      How many failures out of 100 will trigger the circuit to open. This is adapted to the volume() used to handle the window of requests.

      If errorRatio is 40, and volume is 10, 4 failed requests will open the circuit. Default is 60.

      Returns:
      percent of failure that trigger the circuit to open
      See Also:
      Default:
      60
    • volume

      int volume
      Rolling window size used to calculate ratio of failed requests. Default is 10.
      Returns:
      how big a window is used to calculate error errorRatio
      See Also:
      Default:
      10
    • successThreshold

      int successThreshold
      How many successful calls will close a half-open circuit. Nevertheless, the first failed call will open the circuit again. Default is 1.
      Returns:
      number of calls
      Default:
      1
    • skipOn

      Class<? extends Throwable>[] skipOn
      These throwables will not be considered failures, all other will.
      Returns:
      throwable classes to not be considered a failure
      See Also:
      Default:
      {}
    • applyOn

      Class<? extends Throwable>[] applyOn
      These throwables will be considered failures.
      Returns:
      throwable classes to be considered a failure
      See Also:
      Default:
      {}