HttpClient 429 + Retry-After package
A copy/paste handler that parses Retry-After (seconds and HTTP date) plus a 429 runbook and logging fields so throttling becomes bounded, observable, and non-amplifying in .NET.
Whatβs inside
Individual files are accessible (best for SEO/AI), plus you can download the full ZIP.
From this article
Browse allWhat you get (4 files):
π RetryAfterDelegatingHandler.cs: Backpressure-aware HttpClient handler
- Correct parsing: Retry-After seconds and HTTP date
- Boundaries: max delay cap and optional jitter
- Integration hint: register with HttpClientFactory or wrap in your own client
β 429-retry-after-runbook.md: Operator runbook for sustained throttling
- Confirm source: which dependency is actually returning 429
- Contain: cap concurrency, shed low priority, slow down safely
- Recover: validate reduction in retry amplification
π retry-after-logging-fields.md: Field list for queryable incident logs
- Decision fields: wait, reason, attempt, budget, route
- Correlation: correlate retries to request and job IDs
- Queries: how to prove you honored backpressure
π README.md: Setup + guardrails
- Where to put the handler
- Defaults to start with
- What not to retry (unsafe side effects)
Quick reference (inline preview):
Decision rule for 429
- If Retry-After present and within budget: delay-and-retry (bounded)
- If Retry-After missing: short bounded backoff + escalate if sustained
- If side effect is not idempotent: fail-fast and surface an actionable errorIf you need this standardized across services (not just one HttpClient), this is the full policy system.
Retry Policy Kit ($49) β
Newsletter
Get the .NET production reliability newsletter
Weekly runbooks, failure patterns, and practical fixes.
No spam. Unsubscribe anytime.
Need help implementing this?
I can help you apply this to your systems without the drama.
Work with meSimilar resources
More resources to help you succeed