Class CommonCircuitBreakerConfigurationProperties.InstanceProperties
java.lang.Object
io.github.resilience4j.common.circuitbreaker.configuration.CommonCircuitBreakerConfigurationProperties.InstanceProperties
- Enclosing class:
- CommonCircuitBreakerConfigurationProperties
Class storing property values for configuring
CircuitBreaker
instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns if we should automatically transition to half open after the timer has run out.Gets the shared configuration name.Returns the failure rate threshold for the circuit breaker as percentage.io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.SlidingWindowTypeReturns the wait duration the CircuitBreaker will stay open, before it switches to half closed.Returns if we should enable writable stack traces or not.setAllowHealthIndicatorToFail(Boolean allowHealthIndicatorToFail) When set to true, it allows the health indicator to go to a failed (DOWN) status.setAutomaticTransitionFromOpenToHalfOpenEnabled(Boolean automaticTransitionFromOpenToHalfOpenEnabled) Sets if we should automatically transition to half open after the timer has run out.setBaseConfig(String baseConfig) Sets the shared configuration name.setEnableExponentialBackoff(Boolean enableExponentialBackoff) setEnableRandomizedWait(Boolean enableRandomizedWait) setEventConsumerBufferSize(Integer eventConsumerBufferSize) setExponentialBackoffMultiplier(Double exponentialBackoffMultiplier) setExponentialMaxWaitDurationInOpenState(Duration exponentialMaxWaitDurationInOpenState) setFailureRateThreshold(Float failureRateThreshold) Sets the failure rate threshold for the circuit breaker as percentage.setIgnoreClassBindingExceptions(Boolean ignoreClassBindingExceptions) setIgnoreExceptionPredicate(Class<Predicate<Throwable>> ignoreExceptionPredicate) setIgnoreExceptions(Class<? extends Throwable>[] ignoreExceptions) setMaxWaitDurationInHalfOpenState(Duration maxWaitDurationInHalfOpenState) setMinimumNumberOfCalls(Integer minimumNumberOfCalls) setPermittedNumberOfCallsInHalfOpenState(Integer permittedNumberOfCallsInHalfOpenState) setRandomizedWaitFactor(Double randomizedWaitFactor) setRecordExceptions(Class<? extends Throwable>[] recordExceptions) setRecordFailurePredicate(Class<Predicate<Throwable>> recordFailurePredicate) setRecordResultPredicate(Class<Predicate<Object>> recordResultPredicate) setRegisterHealthIndicator(Boolean registerHealthIndicator) setSlidingWindowSize(Integer slidingWindowSize) setSlidingWindowType(io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.SlidingWindowType slidingWindowType) setSlowCallDurationThreshold(Duration slowCallDurationThreshold) setSlowCallRateThreshold(Float slowCallRateThreshold) setWaitDurationInOpenState(Duration waitDurationInOpenStateMillis) Sets the wait duration the CircuitBreaker should stay open, before it switches to half closed.setWritableStackTraceEnabled(Boolean writableStackTraceEnabled) Sets if we should enable writable stack traces or not.
-
Constructor Details
-
InstanceProperties
public InstanceProperties()
-
-
Method Details
-
getFailureRateThreshold
Returns the failure rate threshold for the circuit breaker as percentage.- Returns:
- the failure rate threshold
-
setFailureRateThreshold
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setFailureRateThreshold(Float failureRateThreshold) Sets the failure rate threshold for the circuit breaker as percentage.- Parameters:
failureRateThreshold- the failure rate threshold
-
getWaitDurationInOpenState
Returns the wait duration the CircuitBreaker will stay open, before it switches to half closed.- Returns:
- the wait duration
-
setWaitDurationInOpenState
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setWaitDurationInOpenState(Duration waitDurationInOpenStateMillis) Sets the wait duration the CircuitBreaker should stay open, before it switches to half closed.- Parameters:
waitDurationInOpenStateMillis- the wait duration
-
getAutomaticTransitionFromOpenToHalfOpenEnabled
Returns if we should automatically transition to half open after the timer has run out.- Returns:
- setAutomaticTransitionFromOpenToHalfOpenEnabled if we should automatically go to half open or not
-
setAutomaticTransitionFromOpenToHalfOpenEnabled
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setAutomaticTransitionFromOpenToHalfOpenEnabled(Boolean automaticTransitionFromOpenToHalfOpenEnabled) Sets if we should automatically transition to half open after the timer has run out.- Parameters:
automaticTransitionFromOpenToHalfOpenEnabled- The flag for automatic transition to half open after the timer has run out.
-
getWritableStackTraceEnabled
Returns if we should enable writable stack traces or not.- Returns:
- writableStackTraceEnabled if we should enable writable stack traces or not.
-
setWritableStackTraceEnabled
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setWritableStackTraceEnabled(Boolean writableStackTraceEnabled) Sets if we should enable writable stack traces or not.- Parameters:
writableStackTraceEnabled- The flag to enable writable stack traces.
-
getEventConsumerBufferSize
-
setEventConsumerBufferSize
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setEventConsumerBufferSize(Integer eventConsumerBufferSize) -
getAllowHealthIndicatorToFail
- Returns:
- the flag that controls if health indicators are allowed to go into a failed (DOWN) status.
- See Also:
-
setAllowHealthIndicatorToFail
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setAllowHealthIndicatorToFail(Boolean allowHealthIndicatorToFail) When set to true, it allows the health indicator to go to a failed (DOWN) status. By default, health indicators for circuit breakers will never go into an unhealthy state.- Parameters:
allowHealthIndicatorToFail- flag to control if the health indicator is allowed to fail- Returns:
- the InstanceProperties
-
getRegisterHealthIndicator
-
setRegisterHealthIndicator
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setRegisterHealthIndicator(Boolean registerHealthIndicator) -
getRecordFailurePredicate
-
setRecordFailurePredicate
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setRecordFailurePredicate(Class<Predicate<Throwable>> recordFailurePredicate) -
getRecordResultPredicate
-
setRecordResultPredicate
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setRecordResultPredicate(Class<Predicate<Object>> recordResultPredicate) -
getRecordExceptions
-
setRecordExceptions
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setRecordExceptions(Class<? extends Throwable>[] recordExceptions) -
getIgnoreExceptionPredicate
-
setIgnoreExceptionPredicate
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setIgnoreExceptionPredicate(Class<Predicate<Throwable>> ignoreExceptionPredicate) -
getIgnoreExceptions
-
setIgnoreExceptions
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setIgnoreExceptions(Class<? extends Throwable>[] ignoreExceptions) -
getBaseConfig
Gets the shared configuration name. If this is set, the configuration builder will use the shared configuration backend over this one.- Returns:
- The shared configuration name.
-
setBaseConfig
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setBaseConfig(String baseConfig) Sets the shared configuration name. If this is set, the configuration builder will use the shared configuration backend over this one.- Parameters:
baseConfig- The shared configuration name.
-
getPermittedNumberOfCallsInHalfOpenState
-
setPermittedNumberOfCallsInHalfOpenState
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setPermittedNumberOfCallsInHalfOpenState(Integer permittedNumberOfCallsInHalfOpenState) -
getMinimumNumberOfCalls
-
setMinimumNumberOfCalls
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setMinimumNumberOfCalls(Integer minimumNumberOfCalls) -
getSlidingWindowSize
-
setSlidingWindowSize
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setSlidingWindowSize(Integer slidingWindowSize) -
getSlowCallRateThreshold
-
setSlowCallRateThreshold
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setSlowCallRateThreshold(Float slowCallRateThreshold) -
getSlowCallDurationThreshold
-
getMaxWaitDurationInHalfOpenState
-
setSlowCallDurationThreshold
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setSlowCallDurationThreshold(Duration slowCallDurationThreshold) -
setMaxWaitDurationInHalfOpenState
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setMaxWaitDurationInHalfOpenState(Duration maxWaitDurationInHalfOpenState) -
getSlidingWindowType
@Nullable public io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.SlidingWindowType getSlidingWindowType() -
setSlidingWindowType
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setSlidingWindowType(io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.SlidingWindowType slidingWindowType) -
getEnableExponentialBackoff
-
setEnableExponentialBackoff
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setEnableExponentialBackoff(Boolean enableExponentialBackoff) -
getExponentialBackoffMultiplier
-
setExponentialBackoffMultiplier
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setExponentialBackoffMultiplier(Double exponentialBackoffMultiplier) -
getExponentialMaxWaitDurationInOpenState
-
setExponentialMaxWaitDurationInOpenState
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setExponentialMaxWaitDurationInOpenState(Duration exponentialMaxWaitDurationInOpenState) -
getEnableRandomizedWait
-
setEnableRandomizedWait
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setEnableRandomizedWait(Boolean enableRandomizedWait) -
getRandomizedWaitFactor
-
setRandomizedWaitFactor
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setRandomizedWaitFactor(Double randomizedWaitFactor) -
getIgnoreClassBindingExceptions
-
setIgnoreClassBindingExceptions
public CommonCircuitBreakerConfigurationProperties.InstanceProperties setIgnoreClassBindingExceptions(Boolean ignoreClassBindingExceptions)
-