Durability: what actually survives a broker restart

RabbitMQ Course · lesson 6 of 15 · 5 min read

Durable queues, persistent messages and publisher confirms each protect a different failure.

Open this lesson in the learning hub

Key points

  • A queue declared durable: true survives a broker restart because its definition is on disk.
  • Message persistence is a separate setting: delivery_mode 2 is persistent, 1 is transient.
  • You need both - a persistent message sitting in a non-durable queue dies with the queue.
  • Even then it is not instant: without publisher confirms there is a window before the write is fsynced.
  • RabbitMQ 3.12 made classic queues write to disk by default, turning x-queue-mode lazy into a no-op.
  • Quorum queues are always durable and replicated, so a transient quorum queue does not exist.

Durable queue plus persistent message plus publisher confirms - any two of the three still lose data.

This is a reading copy. The full lesson — with the visual explainer, the interactive lab and a Run button for the code — lives in the RabbitMQ Course course, and every lesson in it is listed on the RabbitMQ Course contents page.