Most message systems promise at-least-once delivery: your handler will see every message — and some of them twice. “Exactly-once delivery” end to end is largely a marketing term; the instant a network or a crash sits between producer and consumer, redelivery is unavoidable.

So the duplicate is not an edge case. It’s the contract.

The consumer must produce the same result when it processes the same message twice — via an idempotency key, a dedup table keyed on message id, or a naturally idempotent operation. Teams that treat duplicates as “shouldn’t happen” ship double-charged customers and double-sent emails, then discover the guarantee they relied on never existed.

Design every consumer as if each message arrives twice, because eventually one will.