Delivery count differs from effect count
Duplicate delivery means the same logical work arrives at a consumer more than once. Systems aiming for at-least-once delivery may need to redeliver when acknowledgement is uncertain, so duplication cannot be dismissed as an impossible edge case. Keeping one business effect despite repeated receipt is different from proving that transport occurs only once. Product claims about one-time behavior also have boundaries: production, storage, retrieval, processing and external mutation are distinct stages. Identify the effect meaningful to the user, such as a charge or inventory change. A delivery counter alone cannot establish whether that business effect occurred correctly or was repeated.
Trace a lost acknowledgement after success
In a hypothetical schedule, a consumer commits order E to a database but loses its connection before acknowledgement reaches the broker. The broker cannot confirm completion and may redeliver E. Treating that second receipt as a new order duplicates an effect that already succeeded. Acknowledging before the database change creates the opposite risk: a subsequent failure can lose the work. This explains ordering rather than reports a measured incident. Keep received, processed and durably effected as separate states. Record the acknowledgement and persistence boundaries in an event sequence so that an uncertain transport result is not mistaken for a known failure of the business operation.
Connect transport identity with business identity
Correlate business-operation ID, message ID, redelivery indication, attempt number, consumer and the transaction holding the effect. If republishing creates a new transport ID, message identity alone may not identify the same business operation. Identical payloads can also represent separate legitimate orders, so content equality is not a universal deduplication key. Define who issues the stable operation identity and how retries preserve it. A redelivery flag is useful evidence, not a durable record that the effect already occurred. Count receipts and completed business operations separately. This makes it possible to distinguish expected replay from incorrect repeated effects and from work that never completed at all.
Bind deduplication to the effect boundary
For changes within one database, place the processed-ID record and business update in the same transaction and enforce ID uniqueness. Recording processed first in a separate operation can reject a retry despite an absent effect. Recording it separately afterward can permit another effect when failure occurs in the gap. External payments or notifications do not automatically participate in that database transaction. Their own idempotency keys or status-query contracts may be needed at the effect boundary. Merely creating a deduplication table does not establish end-to-end exactly-once behavior across independent systems. Explain which resource’s atomicity supports the design and where uncertainty remains.
Define retention and replay behavior
Test failures before and after the effect, before and after acknowledgement, consumer restarts, concurrent handling of one ID and delayed redelivery. If processed records expire before the replay horizon, old work can execute again. Align retention with capacity and the maximum supported reprocessing interval. Define whether manual replay retains the operation identity or represents a deliberately new business action. Also verify that legitimate distinct work is not discarded. Evaluate completed work, pending work and duplicate effects rather than optimizing only for zero repeated receipts. This preserves the distinction between a transport guarantee and the correctness of the business operation carried by that transport.