Interface CircuitBreakerConfig

All Superinterfaces:
Prototype.Api, Prototype.Factory<CircuitBreaker>
All Known Implementing Classes:
CircuitBreakerConfig.BuilderBase.CircuitBreakerConfigImpl

public interface CircuitBreakerConfig extends Prototype.Api
Interface generated from definition. Please add javadoc to the definition interface.
See Also:
  • Field Details

  • Method Details

    • builder

      static CircuitBreakerConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static CircuitBreakerConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static CircuitBreakerConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • name

      Optional<String> name()
    • delay

      Duration delay()
      How long to wait before transitioning from open to half-open state.
      Returns:
      delay
    • 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:
    • 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:
    • 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
    • executor

      Executor service to schedule future tasks.
      Returns:
      executor to use
    • skipOn

      Set<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:
    • applyOn

      Set<Class<? extends Throwable>> applyOn()
      These throwables will be considered failures.
      Returns:
      throwable classes to be considered a failure
      See Also: