RabbitMQ
Publisher Confirms & Persistence
Guarantee the broker actually stored a message — survive broker restarts without losing data.
Consumer acks protect the consumer side, but the producer also needs assurance that the broker received and safely stored a message. Publisher confirms provide this: after enabling confirm mode, the broker sends the producer an async ack once it has taken responsibility for the message (and persisted it, if durable). A nack means the broker could not, so the producer should retry.
Sending a registered parcel and waiting for the post office's receipt that it is logged in their system — not just dropping it in a mailbox and hoping. And storing it in a fireproof safe (durable + persistent) so an overnight fire (restart) does not destroy it.
Key Concepts
1
Durability has three independent layers that must all be set: the queue must be declared durable, the message must be marked persistent (delivery mode 2), and ideally it should be on a quorum queue replicated across nodes. Miss any layer and a broker restart can drop messages — for example a persistent message in a non-durable queue still dies with the queue.
2
Together, durable queues + persistent messages + publisher confirms give end-to-end at-least-once from producer to broker.
3
What the interviewer is probing.
What the interviewer is probing.
4
1. "What does a publisher confirm tell you?" *Probing:* the guarantee. *Stalls:* "It was sent."
*Moves up:* the broker took responsibility for the message — with persistence, that it reached disk
or every mirror.
1. "What does a publisher confirm tell you?"
5
2. "What is needed for a message to survive a broker restart?" *Probing:* the full chain.
*Stalls:* "Persistence." *Moves up:* a durable queue, a persistent message, and a publisher confirm
— any one missing breaks the guarantee.
2. "What is needed for a message to survive a broker restart?"
6
3. "Why are confirms asynchronous?" *Probing:* the performance point. *Stalls:* "They are not."
*Moves up:* waiting per message would collapse throughput — you track outstanding sequence numbers
and handle confirms in a callback.
3. "Why are confirms asynchronous?"
7
4. "Does persistence make it safe?" *Probing:* the honest limit. *Stalls:* "Yes." *Moves up:*
not alone — there is a window before the disk flush, which is why quorum queues exist for stronger
guarantees.
4. "Does persistence make it safe?"