Class CircuitBreakerConfigurationProperties.InstanceProperties
java.lang.Object
io.github.resilience4j.common.circuitbreaker.configuration.CircuitBreakerConfigurationProperties.InstanceProperties
- Enclosing class:
- CircuitBreakerConfigurationProperties
public static class CircuitBreakerConfigurationProperties.InstanceProperties
extends java.lang.Object
Class storing property values for configuring
CircuitBreaker
instances.-
Constructor Summary
Constructors Constructor Description InstanceProperties() -
Method Summary
Modifier and Type Method Description java.lang.BooleangetAllowHealthIndicatorToFail()java.lang.BooleangetAutomaticTransitionFromOpenToHalfOpenEnabled()Returns if we should automatically transition to half open after the timer has run out.java.lang.StringgetBaseConfig()Gets the shared configuration name.java.lang.BooleangetEnableExponentialBackoff()java.lang.BooleangetEnableRandomizedWait()java.lang.IntegergetEventConsumerBufferSize()java.lang.DoublegetExponentialBackoffMultiplier()java.time.DurationgetExponentialMaxWaitDurationInOpenState()java.lang.FloatgetFailureRateThreshold()Returns the failure rate threshold for the circuit breaker as percentage.java.lang.Class<? extends java.lang.Throwable>[]getIgnoreExceptions()java.time.DurationgetMaxWaitDurationInHalfOpenState()java.lang.IntegergetMinimumNumberOfCalls()java.lang.IntegergetPermittedNumberOfCallsInHalfOpenState()java.lang.DoublegetRandomizedWaitFactor()java.lang.Class<? extends java.lang.Throwable>[]getRecordExceptions()java.lang.Class<java.util.function.Predicate<java.lang.Throwable>>getRecordFailurePredicate()java.lang.BooleangetRegisterHealthIndicator()java.lang.IntegergetRingBufferSizeInClosedState()Returns the ring buffer size for the circuit breaker while in closed state.java.lang.IntegergetRingBufferSizeInHalfOpenState()Returns the ring buffer size for the circuit breaker while in half open state.java.lang.IntegergetSlidingWindowSize()io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.SlidingWindowTypegetSlidingWindowType()java.time.DurationgetSlowCallDurationThreshold()java.lang.FloatgetSlowCallRateThreshold()java.time.DurationgetWaitDurationInOpenState()Returns the wait duration the CircuitBreaker will stay open, before it switches to half closed.java.lang.BooleangetWritableStackTraceEnabled()Returns if we should enable writable stack traces or not.CircuitBreakerConfigurationProperties.InstancePropertiessetAllowHealthIndicatorToFail(java.lang.Boolean allowHealthIndicatorToFail)When set to true, it allows the health indicator to go to a failed (DOWN) status.CircuitBreakerConfigurationProperties.InstancePropertiessetAutomaticTransitionFromOpenToHalfOpenEnabled(java.lang.Boolean automaticTransitionFromOpenToHalfOpenEnabled)Sets if we should automatically transition to half open after the timer has run out.CircuitBreakerConfigurationProperties.InstancePropertiessetBaseConfig(java.lang.String baseConfig)Sets the shared configuration name.CircuitBreakerConfigurationProperties.InstancePropertiessetEnableExponentialBackoff(java.lang.Boolean enableExponentialBackoff)CircuitBreakerConfigurationProperties.InstancePropertiessetEnableRandomizedWait(java.lang.Boolean enableRandomizedWait)CircuitBreakerConfigurationProperties.InstancePropertiessetEventConsumerBufferSize(java.lang.Integer eventConsumerBufferSize)CircuitBreakerConfigurationProperties.InstancePropertiessetExponentialBackoffMultiplier(java.lang.Double exponentialBackoffMultiplier)CircuitBreakerConfigurationProperties.InstancePropertiessetExponentialMaxWaitDurationInOpenState(java.time.Duration exponentialMaxWaitDurationInOpenState)CircuitBreakerConfigurationProperties.InstancePropertiessetFailureRateThreshold(java.lang.Float failureRateThreshold)Sets the failure rate threshold for the circuit breaker as percentage.CircuitBreakerConfigurationProperties.InstancePropertiessetIgnoreExceptions(java.lang.Class<? extends java.lang.Throwable>[] ignoreExceptions)CircuitBreakerConfigurationProperties.InstancePropertiessetMaxWaitDurationInHalfOpenState(java.time.Duration maxWaitDurationInHalfOpenState)CircuitBreakerConfigurationProperties.InstancePropertiessetMinimumNumberOfCalls(java.lang.Integer minimumNumberOfCalls)CircuitBreakerConfigurationProperties.InstancePropertiessetPermittedNumberOfCallsInHalfOpenState(java.lang.Integer permittedNumberOfCallsInHalfOpenState)CircuitBreakerConfigurationProperties.InstancePropertiessetRandomizedWaitFactor(java.lang.Double randomizedWaitFactor)CircuitBreakerConfigurationProperties.InstancePropertiessetRecordExceptions(java.lang.Class<? extends java.lang.Throwable>[] recordExceptions)CircuitBreakerConfigurationProperties.InstancePropertiessetRecordFailurePredicate(java.lang.Class<java.util.function.Predicate<java.lang.Throwable>> recordFailurePredicate)CircuitBreakerConfigurationProperties.InstancePropertiessetRegisterHealthIndicator(java.lang.Boolean registerHealthIndicator)CircuitBreakerConfigurationProperties.InstancePropertiessetRingBufferSizeInClosedState(java.lang.Integer ringBufferSizeInClosedState)Deprecated.UsesetSlidingWindowSize(Integer)instead.CircuitBreakerConfigurationProperties.InstancePropertiessetRingBufferSizeInHalfOpenState(java.lang.Integer ringBufferSizeInHalfOpenState)Deprecated.UsesetPermittedNumberOfCallsInHalfOpenState(Integer)instead.CircuitBreakerConfigurationProperties.InstancePropertiessetSlidingWindowSize(java.lang.Integer slidingWindowSize)CircuitBreakerConfigurationProperties.InstancePropertiessetSlidingWindowType(io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.SlidingWindowType slidingWindowType)CircuitBreakerConfigurationProperties.InstancePropertiessetSlowCallDurationThreshold(java.time.Duration slowCallDurationThreshold)CircuitBreakerConfigurationProperties.InstancePropertiessetSlowCallRateThreshold(java.lang.Float slowCallRateThreshold)CircuitBreakerConfigurationProperties.InstancePropertiessetWaitDurationInOpenState(java.time.Duration waitDurationInOpenStateMillis)Sets the wait duration the CircuitBreaker should stay open, before it switches to half closed.CircuitBreakerConfigurationProperties.InstancePropertiessetWritableStackTraceEnabled(java.lang.Boolean writableStackTraceEnabled)Sets if we should enable writable stack traces or not.
-
Constructor Details
-
InstanceProperties
public InstanceProperties()
-
-
Method Details
-
getFailureRateThreshold
@Nullable public java.lang.Float getFailureRateThreshold()Returns the failure rate threshold for the circuit breaker as percentage.- Returns:
- the failure rate threshold
-
setFailureRateThreshold
public CircuitBreakerConfigurationProperties.InstanceProperties setFailureRateThreshold(java.lang.Float failureRateThreshold)Sets the failure rate threshold for the circuit breaker as percentage.- Parameters:
failureRateThreshold- the failure rate threshold
-
getWaitDurationInOpenState
@Nullable public java.time.Duration getWaitDurationInOpenState()Returns the wait duration the CircuitBreaker will stay open, before it switches to half closed.- Returns:
- the wait duration
-
setWaitDurationInOpenState
public CircuitBreakerConfigurationProperties.InstanceProperties setWaitDurationInOpenState(java.time.Duration waitDurationInOpenStateMillis)Sets the wait duration the CircuitBreaker should stay open, before it switches to half closed.- Parameters:
waitDurationInOpenStateMillis- the wait duration
-
getRingBufferSizeInClosedState
@Nullable public java.lang.Integer getRingBufferSizeInClosedState()Returns the ring buffer size for the circuit breaker while in closed state.- Returns:
- the ring buffer size
-
setRingBufferSizeInClosedState
@Deprecated public CircuitBreakerConfigurationProperties.InstanceProperties setRingBufferSizeInClosedState(java.lang.Integer ringBufferSizeInClosedState)Deprecated.UsesetSlidingWindowSize(Integer)instead.Sets the ring buffer size for the circuit breaker while in closed state.- Parameters:
ringBufferSizeInClosedState- the ring buffer size
-
getRingBufferSizeInHalfOpenState
@Nullable public java.lang.Integer getRingBufferSizeInHalfOpenState()Returns the ring buffer size for the circuit breaker while in half open state.- Returns:
- the ring buffer size
-
setRingBufferSizeInHalfOpenState
@Deprecated public CircuitBreakerConfigurationProperties.InstanceProperties setRingBufferSizeInHalfOpenState(java.lang.Integer ringBufferSizeInHalfOpenState)Deprecated.UsesetPermittedNumberOfCallsInHalfOpenState(Integer)instead.Sets the ring buffer size for the circuit breaker while in half open state.- Parameters:
ringBufferSizeInHalfOpenState- the ring buffer size
-
getAutomaticTransitionFromOpenToHalfOpenEnabled
public java.lang.Boolean 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 CircuitBreakerConfigurationProperties.InstanceProperties setAutomaticTransitionFromOpenToHalfOpenEnabled(java.lang.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
@Nullable public java.lang.Boolean getWritableStackTraceEnabled()Returns if we should enable writable stack traces or not.- Returns:
- writableStackTraceEnabled if we should enable writable stack traces or not.
-
setWritableStackTraceEnabled
public CircuitBreakerConfigurationProperties.InstanceProperties setWritableStackTraceEnabled(java.lang.Boolean writableStackTraceEnabled)Sets if we should enable writable stack traces or not.- Parameters:
writableStackTraceEnabled- The flag to enable writable stack traces.
-
getEventConsumerBufferSize
@Nullable public java.lang.Integer getEventConsumerBufferSize() -
setEventConsumerBufferSize
public CircuitBreakerConfigurationProperties.InstanceProperties setEventConsumerBufferSize(java.lang.Integer eventConsumerBufferSize) -
getAllowHealthIndicatorToFail
@Nullable public java.lang.Boolean getAllowHealthIndicatorToFail()- Returns:
- the flag that controls if health indicators are allowed to go into a failed (DOWN) status.
- See Also:
setAllowHealthIndicatorToFail(Boolean)
-
setAllowHealthIndicatorToFail
public CircuitBreakerConfigurationProperties.InstanceProperties setAllowHealthIndicatorToFail(java.lang.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
@Nullable public java.lang.Boolean getRegisterHealthIndicator() -
setRegisterHealthIndicator
public CircuitBreakerConfigurationProperties.InstanceProperties setRegisterHealthIndicator(java.lang.Boolean registerHealthIndicator) -
getRecordFailurePredicate
@Nullable public java.lang.Class<java.util.function.Predicate<java.lang.Throwable>> getRecordFailurePredicate() -
setRecordFailurePredicate
public CircuitBreakerConfigurationProperties.InstanceProperties setRecordFailurePredicate(java.lang.Class<java.util.function.Predicate<java.lang.Throwable>> recordFailurePredicate) -
getRecordExceptions
@Nullable public java.lang.Class<? extends java.lang.Throwable>[] getRecordExceptions() -
setRecordExceptions
public CircuitBreakerConfigurationProperties.InstanceProperties setRecordExceptions(java.lang.Class<? extends java.lang.Throwable>[] recordExceptions) -
getIgnoreExceptions
@Nullable public java.lang.Class<? extends java.lang.Throwable>[] getIgnoreExceptions() -
setIgnoreExceptions
public CircuitBreakerConfigurationProperties.InstanceProperties setIgnoreExceptions(java.lang.Class<? extends java.lang.Throwable>[] ignoreExceptions) -
getBaseConfig
@Nullable public java.lang.String getBaseConfig()Gets the shared configuration name. If this is set, the configuration builder will use the the shared configuration backend over this one.- Returns:
- The shared configuration name.
-
setBaseConfig
public CircuitBreakerConfigurationProperties.InstanceProperties setBaseConfig(java.lang.String baseConfig)Sets the shared configuration name. If this is set, the configuration builder will use the the shared configuration backend over this one.- Parameters:
baseConfig- The shared configuration name.
-
getPermittedNumberOfCallsInHalfOpenState
@Nullable public java.lang.Integer getPermittedNumberOfCallsInHalfOpenState() -
setPermittedNumberOfCallsInHalfOpenState
public CircuitBreakerConfigurationProperties.InstanceProperties setPermittedNumberOfCallsInHalfOpenState(java.lang.Integer permittedNumberOfCallsInHalfOpenState) -
getMinimumNumberOfCalls
@Nullable public java.lang.Integer getMinimumNumberOfCalls() -
setMinimumNumberOfCalls
public CircuitBreakerConfigurationProperties.InstanceProperties setMinimumNumberOfCalls(java.lang.Integer minimumNumberOfCalls) -
getSlidingWindowSize
@Nullable public java.lang.Integer getSlidingWindowSize() -
setSlidingWindowSize
public CircuitBreakerConfigurationProperties.InstanceProperties setSlidingWindowSize(java.lang.Integer slidingWindowSize) -
getSlowCallRateThreshold
@Nullable public java.lang.Float getSlowCallRateThreshold() -
setSlowCallRateThreshold
public CircuitBreakerConfigurationProperties.InstanceProperties setSlowCallRateThreshold(java.lang.Float slowCallRateThreshold) -
getSlowCallDurationThreshold
@Nullable public java.time.Duration getSlowCallDurationThreshold() -
getMaxWaitDurationInHalfOpenState
@Nullable public java.time.Duration getMaxWaitDurationInHalfOpenState() -
setSlowCallDurationThreshold
public CircuitBreakerConfigurationProperties.InstanceProperties setSlowCallDurationThreshold(java.time.Duration slowCallDurationThreshold) -
setMaxWaitDurationInHalfOpenState
public CircuitBreakerConfigurationProperties.InstanceProperties setMaxWaitDurationInHalfOpenState(java.time.Duration maxWaitDurationInHalfOpenState) -
getSlidingWindowType
@Nullable public io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.SlidingWindowType getSlidingWindowType() -
setSlidingWindowType
public CircuitBreakerConfigurationProperties.InstanceProperties setSlidingWindowType(io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.SlidingWindowType slidingWindowType) -
getEnableExponentialBackoff
public java.lang.Boolean getEnableExponentialBackoff() -
setEnableExponentialBackoff
public CircuitBreakerConfigurationProperties.InstanceProperties setEnableExponentialBackoff(java.lang.Boolean enableExponentialBackoff) -
getExponentialBackoffMultiplier
@Nullable public java.lang.Double getExponentialBackoffMultiplier() -
setExponentialBackoffMultiplier
public CircuitBreakerConfigurationProperties.InstanceProperties setExponentialBackoffMultiplier(java.lang.Double exponentialBackoffMultiplier) -
getExponentialMaxWaitDurationInOpenState
@Nullable public java.time.Duration getExponentialMaxWaitDurationInOpenState() -
setExponentialMaxWaitDurationInOpenState
public CircuitBreakerConfigurationProperties.InstanceProperties setExponentialMaxWaitDurationInOpenState(java.time.Duration exponentialMaxWaitDurationInOpenState) -
getEnableRandomizedWait
@Nullable public java.lang.Boolean getEnableRandomizedWait() -
setEnableRandomizedWait
public CircuitBreakerConfigurationProperties.InstanceProperties setEnableRandomizedWait(java.lang.Boolean enableRandomizedWait) -
getRandomizedWaitFactor
@Nullable public java.lang.Double getRandomizedWaitFactor() -
setRandomizedWaitFactor
public CircuitBreakerConfigurationProperties.InstanceProperties setRandomizedWaitFactor(java.lang.Double randomizedWaitFactor)
-