Service A → B → C. C fails. B waits for a timeout, exhausts the thread pool. A waits for B. Cascading failure. The Circuit Breaker breaks this chain.
Netflix Hystrix¶
public class GetUserCommand extends HystrixCommand<User> {
@Override
protected User run() {
return client.getUser(userId);
}
@Override
protected User getFallback() {
return User.anonymous();
}
}
Three states: Closed (normal), Open (blocked, fallback), Half-Open (probe call). Thread pool isolation — bulkhead pattern. Hystrix Dashboard for real-time visualisation.
Fallback strategies¶
- Static/cached value
- Degraded response
- Alternative service
- Fail fast (better than a timeout)
Circuit Breaker is essential equipment¶
In a distributed system, things fail. CB prevents cascading collapse.
Need help with implementation?
Our experts can help with design, implementation, and operations. From architecture to production.
Contact us