All the right resilience policies, stacked in the wrong order. The timeout caps all five retries together, the breaker is rebuilt on every request so it never opens, and a 404 gets retried five times.
Intermediate25 min on the clock7 graded checks · 100 pointsServices That Fail Politely
AssumesA deadline and a request to stopA per-call deadline linked to the caller’s token, written by hand. The timeout policy here does the same job, so it is worth knowing what it is doing for you.
Graded by reading your code against the checklist below.
What you build
Add the policies in the order retry, then breaker, then timeout
Share one circuit breaker across all requests
Retry transient failures only, not every non-success status
Treat a per-attempt timeout as transient, so it is retried
Back off exponentially, with jitter
Get the logger from the container the handler is given
Read the Catalogue URL from configuration
Done means
Retry outside breaker outside timeout, one shared breaker, transient errors only, exponential backoff with jitter, nothing hard-coded.
How it is graded
Published in full, before you start — every point is one of these and there is nothing else.
Retry, then breaker, then timeout+25Retrying what might work next time
One circuit breaker, shared by every request+20Retrying what might work next time
Only transient failures are retried+15Retrying what might work next time
A timed-out attempt is retried+10Rate limiting and cancellation
Exponential backoff with jitter+10Retrying what might work next time
The logger comes from the real container+10Giving resources back
The Catalogue URL comes from configuration+10Settings, not string literals
What it teaches
Retrying what might work next timeintermediate
A call to another service will sometimes fail for a reason that is gone a second later; retrying with growing gaps fixes those, and a circuit breaker stops you hammering a service that is not coming back soon.
A proxy in front of a paid API needs a rate limit or one user can spend your whole budget, and a cancellation token so a closed browser tab stops the work.
A file handle or socket you opened is yours to release — the Dispose pattern is how a caller gets to say "I am finished with this" instead of waiting for a collection that may never come.