← Back to the chapter · Previous detail

Technical detail · AMQP Frames: Storage and Throughput Calculations

Settlement modes and uncertain outcomes

At-most-once uses a pre-settled send: the sender sends and forgets. It is fast but may lose a delivery. At-least-once leaves the delivery unsettled until an accepted outcome is known; a missing outcome creates uncertainty and retry can duplicate work.

The coordinated pattern uses rcv-settle-mode = second: the receiver retains outcome state until the sender settles, then settles its side. This supports exactly-once link transfer under the required state retention and recovery behavior. Selecting the mode alone does not ensure loss-free recovery after arbitrary failures. AMQP 0-9-1 offers no native exactly-once settlement mode; systems commonly combine at-least-once delivery with idempotent consumers.

A temperature sample sent every few seconds may tolerate pre-settlement because a later sample replaces it. A valve command should generally retain outcome evidence. Give the command an identity and make repeat handling idempotent, so a retry does not repeat its action. If acceptance was recorded, settle that accepted delivery rather than retrying it as though the outcome were unknown.

Accepting a delivery and writing a database are separate events unless explicitly coordinated. Settlement on the AMQP link cannot by itself make that database write or a physical action occur exactly once; those side effects need idempotency or transaction boundaries.

← Back to the chapter · Previous detail