Which statement best describes the role of message durability in RabbitMQ?
Think about what happens to messages when RabbitMQ restarts.
Durable messages are saved to disk and survive broker restarts only if the queue they are in is also durable.
What happens when you publish a non-persistent message to a durable queue and then restart RabbitMQ?
rabbitmqadmin publish routing_key=test_queue payload='Hello' delivery_mode=1 # Then restart RabbitMQ server
Consider what delivery_mode=1 means for message persistence.
Delivery mode 1 means non-persistent message; such messages are not saved to disk even if the queue is durable, so they are lost on restart.
Which RabbitMQ queue declaration ensures messages are durable and survive broker restarts?
channel.queue_declare(queue='task_queue', durable=___)Durable queues require a specific boolean value.
Setting durable=True makes the queue survive broker restarts, allowing durable messages to persist.
Which sequence of steps correctly ensures that messages are persistent and survive RabbitMQ restarts?
Both queue and message must be durable for persistence.
Only durable queues combined with persistent messages (delivery_mode=2) ensure messages survive restarts.
You declared a durable queue and published messages with delivery_mode=2, but messages are lost after RabbitMQ restarts. What is the most likely cause?
Consider the timing of queue declaration relative to message publishing.
If the queue is redeclared without durable=True after messages are published, the queue is recreated as non-durable, causing message loss on restart.