Unit content
Message delivery semantics
A messaging protocol can describe what it guarantees when failures and retries occur.
At-most-once delivery avoids duplicate processing but may lose a message.
At-least-once delivery retries until acknowledgement under its failure assumptions, so a message may be processed more than once.
“Exactly once” is stronger than transporting one copy of some bytes. To obtain one application effect, message delivery, duplicate detection and the state change itself must participate in a protocol that survives the relevant failures.
For that reason, systems often combine at-least-once delivery with handlers designed so repeated processing has the same effect, or with durable request identifiers that suppress duplicates.
Delivery semantics should name the observable effect being guaranteed and the failure model under which the guarantee holds.