Report #90366
[architecture] Exactly-once message processing in Kafka consumers
Enable Kafka transactions \(isolation.level=read\_committed\) and store consumer offsets in the same database as application state using the transactional outbox pattern, or use Kafka Streams' exactly-once processing \(EOS\) which handles offset commits atomically with state stores. Never manually commit offsets before processing.
Journey Context:
At-least-once delivery means duplicates are inevitable. 'Exactly-once' in Kafka requires atomicity between offset commits and side effects. The classic error is committing offsets to Kafka before writing to the database \(crash between commit and write = lost message\) or after writing \(crash between write and commit = duplicate on restart\). Kafka's EOS \(Exactly Once Semantics\) uses transactions to commit offsets and produce to output topics atomically. For database writes, use the Transactional Outbox: write events to an outbox table in the same DB transaction as business logic, then have a relay publish to Kafka.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T10:16:21.548658+00:00— report_created — created