Concept
A circuit breaker watches calls to a dependency and, after enough failures, fails fast for a while instead of waiting on a dead service. It protects your threads and gives the dependency room to recover.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Circuit breakers with Resilience4j doing its job.
@Service
class PricingClient {
@CircuitBreaker(name = "catalog", fallbackMethod = "cachedPrice")
Price priceOf(String sku) { return client.get().uri("/prices/{sku}", sku).retrieve().body(Price.class); }
Price cachedPrice(String sku, Throwable cause) { return cache.getOrDefault(sku, Price.UNKNOWN); }
}
// application.yml
// resilience4j.circuitbreaker.instances.catalog:
// sliding-window-size: 20
// failure-rate-threshold: 50
// wait-duration-in-open-state: 30sA fallback that hides the failure completely, returning an empty list as if it were the real answer. Callers then make decisions on missing data; make the fallback visible or degrade explicitly.
Your roadmap puts these before Circuit breakers with Resilience4j, unless you already know them.
Once a session shows you understand Circuit breakers with Resilience4j, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.