Exactly-once processing.
also: exactly-once · exactly once · exactly-once delivery · exactly-once semantics · effectively onceEach message's effect happens once; in practice at-least-once delivery plus idempotent or transactional processing.
the two-minute refresher
- Very hard to guarantee end to end across networks.
- Approach 1: idempotent producer (retries keep the same ID) plus a consumer that ignores IDs it has processed.
- Approach 2: transactions, such as Kafka's atomic produce + consume, or the outbox pattern.
- Record the processed ID in the same transaction as the side effect, or a crash in between double-processes.