Technical detail ยท AMQP Operations: Capacity Tools and Diagnostics
Track asynchronous confirms and routing returns
Call confirm.select once to put the channel in confirm mode. Continue publishing while keeping each delivery tag, a monotonically increasing sequence number on that channel, in an outstanding map. The broker acknowledges tags asynchronously rather than making the publisher wait after every send.
A basic.ack clears the indicated message. With multiple=true, it clears every outstanding tag up to and including that tag, allowing efficient acknowledgement ranges. A basic.nack means the broker could not take responsibility; the publisher must retain the message for retry.
For a finally unroutable publish sent with mandatory, basic.return arrives before its confirm. A confirm alone can acknowledge the publish as handled even though no queue accepted a copy. Record the returned message as a routing failure rather than treating that confirm as successful queue delivery.
Remove confirmed entries, retry nacks and unknown outcomes with duplicate-safe message IDs, and keep return handling separate. A quorum queue plus successful confirms protects broker acceptance while permitting throughput without per-message blocking. Consumer acknowledgements, idempotent processing and final outcome evidence remain separate responsibilities.