Uses of Class
dev.failsafe.CircuitBreakerBuilder
Packages that use CircuitBreakerBuilder
-
Uses of CircuitBreakerBuilder in dev.failsafe
Methods in dev.failsafe that return CircuitBreakerBuilderModifier and TypeMethodDescriptionstatic <R> CircuitBreakerBuilder
<R> CircuitBreaker.builder()
Creates a CircuitBreakerBuilder that by default will build a count based circuit breaker that opens after asingle failure
, closes after asingle success
, and has a 1 minutedelay
, unless configured otherwise.static <R> CircuitBreakerBuilder
<R> CircuitBreaker.builder
(CircuitBreakerConfig<R> config) Creates a new CircuitBreakerBuilder that will be based on theconfig
.CircuitBreakerBuilder.onClose
(EventListener<CircuitBreakerStateChangedEvent> listener) Calls thelistener
when the circuit is closed.CircuitBreakerBuilder.onHalfOpen
(EventListener<CircuitBreakerStateChangedEvent> listener) Calls thelistener
when the circuit is half-opened.CircuitBreakerBuilder.onOpen
(EventListener<CircuitBreakerStateChangedEvent> listener) Calls thelistener
when the circuit is opened.Sets thedelay
to wait in OPEN state before transitioning to half-open.CircuitBreakerBuilder.withFailureRateThreshold
(int failureRateThreshold, int failureExecutionThreshold, Duration failureThresholdingPeriod) Configures time based failure rate thresholding by setting the percentage rate of failures, from 1 to 100, that must occur within the rollingfailureThresholdingPeriod
when in a CLOSED state in order to open the circuit.CircuitBreakerBuilder.withFailureThreshold
(int failureThreshold) Configures count based failure thresholding by setting the number of consecutive failures that must occur when in a CLOSED state in order to open the circuit.CircuitBreakerBuilder.withFailureThreshold
(int failureThreshold, int failureThresholdingCapacity) Configures count based failure thresholding by setting the ratio of failures to executions that must occur when in a CLOSED state in order to open the circuit.CircuitBreakerBuilder.withFailureThreshold
(int failureThreshold, int failureExecutionThreshold, Duration failureThresholdingPeriod) Configures time based failure thresholding by setting the number of failures that must occur within thefailureThresholdingPeriod
when in a CLOSED state in order to open the circuit.CircuitBreakerBuilder.withFailureThreshold
(int failureThreshold, Duration failureThresholdingPeriod) Configures time based failure thresholding by setting the number of failures that must occur within thefailureThresholdingPeriod
when in a CLOSED state in order to open the circuit.CircuitBreakerBuilder.withSuccessThreshold
(int successThreshold) Configures count based success thresholding by setting the number of consecutive successful executions that must occur when in a HALF_OPEN state in order to close the circuit, else the circuit is re-opened when a failure occurs.CircuitBreakerBuilder.withSuccessThreshold
(int successThreshold, int successThresholdingCapacity) Configures count based success thresholding by setting the ratio of successful executions that must occur when in a HALF_OPEN state in order to close the circuit.