Exactly-once payment events
Your task
Design exactly-once processing for a payment-events pipeline where an upstream service emits 'payment.captured' events to Kafka and a downstream consumer must, per event, post to the ledger and send one receipt email, each side effect exactly once, despite Kafka's at-least-once delivery, consumer crashes, and rebalances that replay messages. ~25,000 events/sec. Describe how the producer avoids losing/duplicating events and how the consumer achieves exactly-once side effects.
It covers
- Message dedup
- Exactly once processing
- Outbox