An application calls a third-party shipping-rate API. During an extended outage of that API, every request tied up a thread for the full timeout before failing, exhausting the application's thread pool and degrading unrelated features. Timeouts and retries with backoff are already in place. Which pattern should the developer add?
Choose one.
The circuit breaker pattern: stop calling a failing dependency, fail fast or serve a fallback, and probe for recovery after a cooling-off period.
Timeouts and backoff retries handle transient errors, but during an extended outage they still let every request wait out its timeout, which is what exhausted the thread pool. A circuit breaker adds the missing behavior: after a threshold of consecutive failures the circuit opens and subsequent calls fail immediately (or return a fallback such as cached rates), so threads are freed instantly; after a cooling period, a few trial calls test recovery before the circuit closes. Raising the timeout or the retry count increases the time threads spend waiting on a dead dependency. Adding capacity only delays exhaustion while wasting resources. This is exactly the resilience skill DVA-C02 v2.1 added for third-party integrations, whose availability and rate limits you do not control.
- Note that transient-error tooling (timeouts, backoff retries) is already in place and the failure is an extended outage.
- Identify the damage mechanism: threads held for the full timeout on every doomed call.
- Apply a circuit breaker: open after consecutive failures, fail fast or serve a fallback while open.
- After a cooling-off period, let trial calls test the dependency before closing the circuit.
Exam tip: Timeouts and retries handle transient errors; an extended third-party outage needs a circuit breaker that fails fast instead of tying up threads.
Application Development Patterns on AWS: Architecture, APIs and Messaging — the lesson that teaches this.