public abstract class CircuitBreaker extends Object
ServiceCall
.
A circuit breaker is used to provide stability and prevent cascading
failures in distributed systems. An example would be to begin to fail-fast
after some number of failures due to a dependency on a hanging call.Modifier and Type | Class and Description |
---|---|
static class |
CircuitBreaker.CircuitBreakerId |
static class |
CircuitBreaker.NamedCircuitBreaker
A named circuit breaker.
|
Modifier and Type | Method and Description |
---|---|
static CircuitBreaker |
identifiedBy(String id)
Use a circuit breaker identified by the given circuit breaker ID.
|
static CircuitBreaker |
none()
Do not use a Circuit breaker for this service call.
|
static CircuitBreaker |
perNode()
Use a circuit breaker per node, if supported.
|
static CircuitBreaker |
perService()
Use a circuit breaker per service.
|
public static CircuitBreaker none()
public static CircuitBreaker perNode()
public static CircuitBreaker perService()
public static CircuitBreaker identifiedBy(String id)
id
- The ID of the circuit breaker.