What does at-most-once delivery mean?
At-most-once delivery means a message is delivered zero or one times, so duplicates are avoided at the cost of possible loss.
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 2521–2532 of 3610 questions
At-most-once delivery means a message is delivered zero or one times, so duplicates are avoided at the cost of possible loss.
At-least-once delivery aims to ensure a message is processed one or more times, usually by acknowledging or committing only after processing.
Exactly-once is not a universal end-to-end switch; its meaning depends on the boundaries covered by the broker and application.
Duplicates can arise when a broker redelivers after missing acknowledgements, a producer retries after an ambiguous timeout, or a consumer crashes after applying a side effect but before committing progress.
Choose semantics based on the consequence of loss versus duplication, processing cost, and whether the side effect can be made idempotent.
An idempotent handler can process the same message repeatedly while producing the same intended business outcome as processing it once.
A consumer can store each message's stable event ID in a processed-message table with a unique constraint in the same database transaction as its business update.
An idempotency key identifies one logical payment request across retries.
A separate read followed by an insert can race: two workers may both see no processed record and then perform the side effect.
Use the external API's idempotency key when available and persist a local operation state to recover after ambiguous timeouts.
Ordering is typically guaranteed only within a defined scope, such as a RabbitMQ queue under specific conditions or a Kafka partition.
Use a stable customer identifier as the record key so events for one customer normally go to the same partition.