Class CircuitBreakerConfiguration

    • Field Detail

      • DIAGNOSTIC_SUMMARY_ENABLED_PROPERTY

        public static final String DIAGNOSTIC_SUMMARY_ENABLED_PROPERTY
        Set this JVM system property to true to include the opening diagnostic summary in circuit-breaker rejection messages.

        Defaults to false; snapshot collection and recent failure history are unaffected.

        See Also:
        Constant Field Values
      • DEFAULT_FAILURE_RATE_THRESHOLD

        public static final int DEFAULT_FAILURE_RATE_THRESHOLD
        See Also:
        Constant Field Values
      • DEFAULT_SLOW_CALL_RATE_THRESHOLD

        public static final int DEFAULT_SLOW_CALL_RATE_THRESHOLD
        See Also:
        Constant Field Values
      • DEFAULT_WAIT_DURATION_IN_OPEN_STATE

        public static final int DEFAULT_WAIT_DURATION_IN_OPEN_STATE
        See Also:
        Constant Field Values
      • DEFAULT_MAX_WAIT_DURATION_IN_HALF_OPEN_STATE

        public static final int DEFAULT_MAX_WAIT_DURATION_IN_HALF_OPEN_STATE
        See Also:
        Constant Field Values
      • DEFAULT_PERMITTED_CALLS_IN_HALF_OPEN_STATE

        public static final int DEFAULT_PERMITTED_CALLS_IN_HALF_OPEN_STATE
        See Also:
        Constant Field Values
      • DEFAULT_MINIMUM_NUMBER_OF_CALLS

        public static final int DEFAULT_MINIMUM_NUMBER_OF_CALLS
        See Also:
        Constant Field Values
      • DEFAULT_SLIDING_WINDOW_SIZE

        public static final int DEFAULT_SLIDING_WINDOW_SIZE
        See Also:
        Constant Field Values
      • DEFAULT_SLOW_CALL_DURATION_THRESHOLD

        public static final int DEFAULT_SLOW_CALL_DURATION_THRESHOLD
        See Also:
        Constant Field Values
      • DEFAULT_WRITABLE_STACK_TRACE_ENABLED

        public static final boolean DEFAULT_WRITABLE_STACK_TRACE_ENABLED
        See Also:
        Constant Field Values
      • NUMBER_OF_RECORDED_HISTORY_RESPONSES

        public static final int NUMBER_OF_RECORDED_HISTORY_RESPONSES
        See Also:
        Constant Field Values
    • Constructor Detail

      • CircuitBreakerConfiguration

        protected CircuitBreakerConfiguration​(int failureRateThreshold,
                                              int slowCallRateThreshold,
                                              Duration waitDurationInOpenState,
                                              int permittedNumberOfCallsInHalfOpenState,
                                              int minimumNumberOfCalls,
                                              int slidingWindowSize,
                                              Duration slowCallDurationThreshold,
                                              boolean writableStackTraceEnabled,
                                              Set<Integer> recordHttpStatuses,
                                              List<Class<? extends RuntimeException>> recordExceptions,
                                              boolean recordProcessingFailures)
      • CircuitBreakerConfiguration

        @ConstructorProperties({"failureRateThreshold","slowCallRateThreshold","waitDurationInOpenState","permittedNumberOfCallsInHalfOpenState","minimumNumberOfCalls","slidingWindowSize","slowCallDurationThreshold","writableStackTraceEnabled","recordHttpStatuses","recordExceptions","numberOfRecordedHistoryResponses"})
        protected CircuitBreakerConfiguration​(int failureRateThreshold,
                                              int slowCallRateThreshold,
                                              Duration waitDurationInOpenState,
                                              int permittedNumberOfCallsInHalfOpenState,
                                              int minimumNumberOfCalls,
                                              int slidingWindowSize,
                                              Duration slowCallDurationThreshold,
                                              boolean writableStackTraceEnabled,
                                              Set<Integer> recordHttpStatuses,
                                              List<Class<? extends RuntimeException>> recordExceptions,
                                              boolean recordProcessingFailures,
                                              int numberOfRecordedHistoryResponses)
        Use builder() instead.
        Parameters:
        failureRateThreshold -
        slowCallRateThreshold -
        waitDurationInOpenState -
        permittedNumberOfCallsInHalfOpenState -
        minimumNumberOfCalls -
        slidingWindowSize -
        slowCallDurationThreshold -
        writableStackTraceEnabled -
        recordHttpStatuses -
        recordExceptions -
        recordProcessingFailures -
        numberOfRecordedHistoryResponses -
      • CircuitBreakerConfiguration

        @ConstructorProperties({"failureRateThreshold","slowCallRateThreshold","waitDurationInOpenState","permittedNumberOfCallsInHalfOpenState","minimumNumberOfCalls","slidingWindowSize","slowCallDurationThreshold","writableStackTraceEnabled","recordHttpStatuses","recordExceptions","recordProcessingFailures","numberOfRecordedHistoryResponses","maxWaitDurationInHalfOpenState"})
        protected CircuitBreakerConfiguration​(int failureRateThreshold,
                                              int slowCallRateThreshold,
                                              Duration waitDurationInOpenState,
                                              int permittedNumberOfCallsInHalfOpenState,
                                              int minimumNumberOfCalls,
                                              int slidingWindowSize,
                                              Duration slowCallDurationThreshold,
                                              boolean writableStackTraceEnabled,
                                              Set<Integer> recordHttpStatuses,
                                              List<Class<? extends RuntimeException>> recordExceptions,
                                              boolean recordProcessingFailures,
                                              int numberOfRecordedHistoryResponses,
                                              Duration maxWaitDurationInHalfOpenState)
      • CircuitBreakerConfiguration

        @ConstructorProperties({"failureRateThreshold","slowCallRateThreshold","waitDurationInOpenState","permittedNumberOfCallsInHalfOpenState","minimumNumberOfCalls","slidingWindowSize","slowCallDurationThreshold","writableStackTraceEnabled","recordHttpStatuses","recordExceptions","recordProcessingFailures","numberOfRecordedHistoryResponses","maxWaitDurationInHalfOpenState","circuitBreakerEventListener"})
        protected CircuitBreakerConfiguration​(int failureRateThreshold,
                                              int slowCallRateThreshold,
                                              Duration waitDurationInOpenState,
                                              int permittedNumberOfCallsInHalfOpenState,
                                              int minimumNumberOfCalls,
                                              int slidingWindowSize,
                                              Duration slowCallDurationThreshold,
                                              boolean writableStackTraceEnabled,
                                              Set<Integer> recordHttpStatuses,
                                              List<Class<? extends RuntimeException>> recordExceptions,
                                              boolean recordProcessingFailures,
                                              int numberOfRecordedHistoryResponses,
                                              Duration maxWaitDurationInHalfOpenState,
                                              CircuitBreakerEventListener circuitBreakerEventListener)
      • CircuitBreakerConfiguration

        public CircuitBreakerConfiguration()
    • Method Detail

      • isDiagnosticSummaryEnabled

        public static boolean isDiagnosticSummaryEnabled()
        Returns whether opening diagnostic summaries should be included in rejection messages.
      • getFailureRateThreshold

        public int getFailureRateThreshold()
      • getSlowCallRateThreshold

        public int getSlowCallRateThreshold()
      • getWaitDurationInOpenState

        public Duration getWaitDurationInOpenState()
      • getMaxWaitDurationInHalfOpenState

        public Duration getMaxWaitDurationInHalfOpenState()
        Returns the HALF_OPEN timeout (default: 30 seconds).

        Expiry reopens the breaker without cancelling in-flight HTTP requests. Validated when the circuit breaker is created.

      • getPermittedNumberOfCallsInHalfOpenState

        public int getPermittedNumberOfCallsInHalfOpenState()
      • getMinimumNumberOfCalls

        public int getMinimumNumberOfCalls()
      • getSlidingWindowSize

        public int getSlidingWindowSize()
      • getSlowCallDurationThreshold

        public Duration getSlowCallDurationThreshold()
      • isWritableStackTraceEnabled

        public boolean isWritableStackTraceEnabled()
      • getNumberOfRecordedHistoryResponses

        public int getNumberOfRecordedHistoryResponses()
      • getRecordHttpStatuses

        public Set<Integer> getRecordHttpStatuses()
      • isRecordProcessingFailures

        public boolean isRecordProcessingFailures()