Report #12206
[architecture] Should I implement exactly-once delivery or at-least-once delivery in my message queue?
Use at-least-once delivery combined with idempotent consumers. Implement deduplication by storing the message ID or idempotency key within the same transaction as your business state change, ensuring atomic processing.
Journey Context:
Exactly-once semantics \(EOS\) in Kafka or similar requires distributed transactions \(2PC\), transactional producers, and complex consumer group coordination, adding significant latency and operational fragility. In practice, network partitions and consumer crashes make true exactly-once impossible without idempotency anyway. The robust pattern is: \(1\) consumers must be idempotent by design using natural keys, \(2\) store the message offset or idempotency key in the same database transaction as the business effect, ensuring atomicity. This handles replays and duplicates naturally without distributed transaction coordinators.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:19:37.863424+00:00— report_created — created