Fallbacks and degradation
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
keep serving something useful, honestly.
Planned topics
- A fallback runs when the call fails: cached value, default, or partial response.
- Degrade optional features first (reviews, recommendations); fail clearly for essential ones (payment).
- Be honest: never show a made-up "payment succeeded". Show "reviews unavailable".
- Mark degraded responses so clients and monitoring know.
- Stale cache is a valid fallback only if stale is acceptable for that data.
Draft outline details
Demonstration
@CircuitBreaker(name = "reviews", fallbackMethod = "noReviews")
List<Review> reviews(long productId) { ... }
List<Review> noReviews(long productId, Throwable t) { return List.of(); } // UI: "Reviews unavailable"Check your understanding
Should checkout fall back to "payment OK" if payments is down?
Show answer
No; fail honestly or leave the order pending.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.