Class CircuitBreakerConfig

java.lang.Object
io.github.resilience4j.circuitbreaker.CircuitBreakerConfig
All Implemented Interfaces:
Serializable

public class CircuitBreakerConfig extends Object implements Serializable
See Also:
  • Field Details

    • DEFAULT_FAILURE_RATE_THRESHOLD

      public static final int DEFAULT_FAILURE_RATE_THRESHOLD
      See Also:
    • DEFAULT_SLOW_CALL_RATE_THRESHOLD

      public static final int DEFAULT_SLOW_CALL_RATE_THRESHOLD
      See Also:
    • DEFAULT_WAIT_DURATION_IN_OPEN_STATE

      public static final int DEFAULT_WAIT_DURATION_IN_OPEN_STATE
      See Also:
    • DEFAULT_PERMITTED_CALLS_IN_HALF_OPEN_STATE

      public static final int DEFAULT_PERMITTED_CALLS_IN_HALF_OPEN_STATE
      See Also:
    • DEFAULT_MINIMUM_NUMBER_OF_CALLS

      public static final int DEFAULT_MINIMUM_NUMBER_OF_CALLS
      See Also:
    • DEFAULT_SLIDING_WINDOW_SIZE

      public static final int DEFAULT_SLIDING_WINDOW_SIZE
      See Also:
    • DEFAULT_SLOW_CALL_DURATION_THRESHOLD

      public static final int DEFAULT_SLOW_CALL_DURATION_THRESHOLD
      See Also:
    • DEFAULT_WAIT_DURATION_IN_HALF_OPEN_STATE

      public static final int DEFAULT_WAIT_DURATION_IN_HALF_OPEN_STATE
      See Also:
    • DEFAULT_SLIDING_WINDOW_TYPE

      public static final CircuitBreakerConfig.SlidingWindowType DEFAULT_SLIDING_WINDOW_TYPE
    • DEFAULT_WRITABLE_STACK_TRACE_ENABLED

      public static final boolean DEFAULT_WRITABLE_STACK_TRACE_ENABLED
      See Also:
  • Method Details

    • custom

      public static CircuitBreakerConfig.Builder custom()
      Returns a builder to create a custom CircuitBreakerConfig.
      Returns:
      a CircuitBreakerConfig.Builder
    • from

      public static CircuitBreakerConfig.Builder from(CircuitBreakerConfig baseConfig)
      Returns a builder to create a custom CircuitBreakerConfig based on another CircuitBreakerConfig.
      Returns:
      a CircuitBreakerConfig.Builder
    • ofDefaults

      public static CircuitBreakerConfig ofDefaults()
      Creates a default CircuitBreaker configuration.
      Returns:
      a default CircuitBreaker configuration.
    • getFailureRateThreshold

      public float getFailureRateThreshold()
    • getWaitIntervalFunctionInOpenState

      public io.github.resilience4j.core.IntervalFunction getWaitIntervalFunctionInOpenState()
      Returns an interval function which controls how long the CircuitBreaker should stay open, before it switches to half open.
      Returns:
      the CircuitBreakerConfig.Builder
    • getTransitionOnResult

      public Function<io.github.resilience4j.core.functions.Either<Object,Throwable>,CircuitBreakerConfig.TransitionCheckResult> getTransitionOnResult()
    • getSlidingWindowSize

      public int getSlidingWindowSize()
    • getRecordExceptionPredicate

      public Predicate<Throwable> getRecordExceptionPredicate()
    • getRecordResultPredicate

      public Predicate<Object> getRecordResultPredicate()
    • getIgnoreExceptionPredicate

      public Predicate<Throwable> getIgnoreExceptionPredicate()
    • getCurrentTimestampFunction

      public Function<Clock,Long> getCurrentTimestampFunction()
    • getTimestampUnit

      public TimeUnit getTimestampUnit()
    • isAutomaticTransitionFromOpenToHalfOpenEnabled

      public boolean isAutomaticTransitionFromOpenToHalfOpenEnabled()
    • getMinimumNumberOfCalls

      public int getMinimumNumberOfCalls()
    • isWritableStackTraceEnabled

      public boolean isWritableStackTraceEnabled()
    • getPermittedNumberOfCallsInHalfOpenState

      public int getPermittedNumberOfCallsInHalfOpenState()
    • getSlidingWindowType

      public CircuitBreakerConfig.SlidingWindowType getSlidingWindowType()
    • getSlowCallRateThreshold

      public float getSlowCallRateThreshold()
    • getSlowCallDurationThreshold

      public Duration getSlowCallDurationThreshold()
    • getMaxWaitDurationInHalfOpenState

      public Duration getMaxWaitDurationInHalfOpenState()
    • toString

      public String toString()
      Overrides:
      toString in class Object