← Lessons

quiz vs the machine

Silver1100

System Design

Message Acknowledgement Modes

How a consumer tells the broker a message is safely handled, and what happens if it does not.

4 min read · intro · beat Silver to climb

What an ack does

When a broker hands a message to a consumer, it needs to know whether the work succeeded before it can forget the message. That signal is an acknowledgement, or ack. A negative signal, the nack, says processing failed and asks the broker to redeliver.

Auto ack vs manual ack

  • With auto ack, the broker marks the message done the moment it is delivered. If the consumer crashes mid work, the message is gone. This is fast but unsafe.
  • With manual ack, the consumer acks only after the work fully completes. If it crashes first, the broker redelivers the message to another consumer.

Why timing matters

The rule of thumb is to ack after the side effect, not before. Ack early and you risk losing work on a crash. Ack late and a slow consumer may hold messages, but nothing is lost. Many brokers also enforce an ack deadline: if no ack arrives in time, the message is requeued automatically.

Key idea

Acknowledge a message only after its work is durably complete so a crash leads to redelivery rather than silent loss.

Check yourself

Answer to earn rating on the learn ladder.

1. What does a consumer send to confirm a message was handled?

2. Why is acking after the work safer than acking on delivery?