Give every remote call a timeout and cancellation token. Retry only transient failures and only when the operation is safe or protected by an idempotency key; use exponential backoff with jitter. A circuit breaker limits pressure during sustained failure. Example: builder.Services.AddHttpClient<PaymentClient>() .AddStandardResilienceHandler(); Validate the actual handler policy for your .NET version: separate attempt and total timeouts, bounded retries, and sensible breaker thresholds. Limit concurrency, verify TLS, keep credentials in a secret store, and log correlation IDs without sensitive payloads. Model ambiguous outcomes explicitly—if a payment call times out, query by idempotency key before charging again. Provide degraded behavior only when it is truthful and safe.
Backbencher Developer · · 0 likes