Resilient event delivery
Queue-to-API integrations with cached OAuth credentials, selective retry, and partial-batch failure reporting.
The system at a glance.
A conceptual view of the flow and its boundaries.
The challenge.
Transient API failures, rate limits, and expiring tokens should be handled without unnecessarily replaying every successful record in a queue batch.
My contribution.
Owned event forwarders integrating pre-built communication records with a customer Timeline API.
Implementation.
- Validate required fields and filter payloads to the downstream API contract.
- Reuse a module-level client and cache OAuth tokens across warm invocations.
- Refresh credentials after authentication failures and retry rate limiting, server failures, and network timeouts with exponential backoff.
- Return SQS batchItemFailures so unsuccessful messages can be retried independently.
Design decisions.
Single-record API calls support precise failure attribution but increase HTTP overhead.
Retry budgets balance recovery from transient failures against downstream load and total processing time.
Validation.
Unit tests isolate the API and credentials boundaries. Acceptance tests use representative queue events to exercise delivery behavior.
The outcome.
Added record-level recovery controls to communication-event delivery across multiple email platforms.
Explore the pattern.
The companion repository is an independent educational demonstration built with synthetic examples. It illustrates related engineering patterns and does not contain employer source code or production data. Repositories are currently private; please contact me for access.
Open private GitHub demo