Integration / RabbitMQ Interview Questions
Describe how RabbitMQ ensures message durability?
Message durability in RabbitMQ depends on three things working together, and missing any one of them breaks the guarantee.
- The queue must be declared
durableso its definition survives a broker restart. - The message must be published with
delivery_mode = 2(persistent), so its body is written to disk, not just kept in memory. - The producer should use publisher confirms so it only considers the message safe once the broker has actually confirmed the write.
For higher availability than a single node's disk can offer, quorum queues replicate the message to a majority of nodes via the Raft protocol before acknowledging it, protecting against the loss of any single node.
More Related questions...