Report #14549
[architecture] Guaranteeing exactly-once message processing in async systems
Accept at-least-once delivery and make consumers idempotent; store consumer offsets in the same transaction as side effects \(transactional outbox pattern\) to prevent duplicate processing during crashes.
Journey Context:
Exactly-once delivery is impossible in distributed systems \(Two Generals' Problem\). Network partitions mean you cannot distinguish between a lost message and a slow one. 'Exactly-once' frameworks \(Kafka Transactions\) actually provide idempotent producers \+ at-least-once consumers with offset tracking. The danger is auto-committing offsets before processing: a crash causes loss. The fix is to treat the offset as part of your unit of work. Use the Transactional Outbox pattern: write event to 'outbox' table in same DB transaction as business data change; separate poller publishes to message bus. This ensures atomicity \(db commit \+ outbox write\) without distributed transactions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T21:49:42.191888+00:00— report_created — created