Class CircuitBreakerConfigurationProperties.InstanceProperties

  • Enclosing class:
    CircuitBreakerConfigurationProperties

    public static class CircuitBreakerConfigurationProperties.InstanceProperties
    extends java.lang.Object
    Class storing property values for configuring CircuitBreaker instances.
    • Constructor Detail

      • InstanceProperties

        public InstanceProperties()
    • Method Detail

      • 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
      • 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
      • 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()
      • 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()
      • getRecordFailurePredicate

        @Nullable
        public java.lang.Class<java.util.function.Predicate<java.lang.Throwable>> getRecordFailurePredicate()
      • getRecordExceptions

        @Nullable
        public java.lang.Class<? extends java.lang.Throwable>[] getRecordExceptions()
      • getIgnoreExceptions

        @Nullable
        public java.lang.Class<? extends java.lang.Throwable>[] getIgnoreExceptions()
      • 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()
      • getMinimumNumberOfCalls

        @Nullable
        public java.lang.Integer getMinimumNumberOfCalls()
      • getSlidingWindowSize

        @Nullable
        public java.lang.Integer getSlidingWindowSize()
      • getSlowCallRateThreshold

        @Nullable
        public java.lang.Float getSlowCallRateThreshold()
      • getSlowCallDurationThreshold

        @Nullable
        public java.time.Duration getSlowCallDurationThreshold()
      • getMaxWaitDurationInHalfOpenState

        @Nullable
        public java.time.Duration getMaxWaitDurationInHalfOpenState()
      • getSlidingWindowType

        @Nullable
        public io.github.resilience4j.circuitbreaker.CircuitBreakerConfig.SlidingWindowType getSlidingWindowType()
      • getEnableExponentialBackoff

        public java.lang.Boolean getEnableExponentialBackoff()
      • getExponentialBackoffMultiplier

        @Nullable
        public java.lang.Double getExponentialBackoffMultiplier()
      • getExponentialMaxWaitDurationInOpenState

        @Nullable
        public java.time.Duration getExponentialMaxWaitDurationInOpenState()
      • getEnableRandomizedWait

        @Nullable
        public java.lang.Boolean getEnableRandomizedWait()
      • getRandomizedWaitFactor

        @Nullable
        public java.lang.Double getRandomizedWaitFactor()