retry

Retry on 429 with Retry-After parsing

Rate limits are normal in production; what matters is how clients behave when they hit them. Instead of hammering an upstream with immediate retries, I parse Retry-After (seconds) and sleep before retrying. I still keep an upper bound so one request d

Exponential backoff with jitter for retries

Retries are dangerous when they synchronize; that’s how you turn a minor outage into a stampede. I implement exponential backoff with jitter so clients spread out naturally. The Retry helper takes a shouldRetry predicate and always checks ctx.Done() b

Resilience with Resilience4j

Resilience4j provides resilience patterns for fault tolerance. Circuit breakers prevent cascading failures—open after threshold failures, allow retry after timeout. Rate limiters control request rates. Retry mechanisms handle transient failures. Bulkh