Adding Fallbacks to Circuit Breakers
Learn how to pair a circuit breaker with fallback logic so that when the breaker is open, your service degrades gracefully instead of failing the user request.
Why Fallbacks Matter
A circuit breaker protects your service by failing fast when a dependency is down. But failing fast still means the user gets an error unless you provide a fallback.
A fallback is the plan B that runs when the breaker is open.
The Fallback Contract
A fallback should return a sensible default quickly and never call the same failing dependency. It is invoked when:
- The breaker is open, or
- The protected call throws or times out.
All lessons in this course
- Choosing a Circuit Breaker Library
- Configuring Circuit Breaker Instances
- Integrating into Service Calls
- Adding Fallbacks to Circuit Breakers