0
0
RabbitMQdevops~20 mins

Message durability and persistence in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Message Durability Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding message durability in RabbitMQ

Which statement best describes the role of message durability in RabbitMQ?

ADurable messages are stored only in memory and lost on broker restart.
BDurable messages survive broker restarts only if the queue is durable.
CDurable messages automatically replicate to all consumers.
DDurable messages are deleted immediately after being consumed.
Attempts:
2 left
💡 Hint

Think about what happens to messages when RabbitMQ restarts.

💻 Command Output
intermediate
2:00remaining
Result of publishing a non-persistent message to a durable queue

What happens when you publish a non-persistent message to a durable queue and then restart RabbitMQ?

RabbitMQ
rabbitmqadmin publish routing_key=test_queue payload='Hello' delivery_mode=1
# Then restart RabbitMQ server
AThe message is duplicated after restart.
BThe message is saved and delivered after restart.
CThe message is lost after restart.
DRabbitMQ throws an error on publishing.
Attempts:
2 left
💡 Hint

Consider what delivery_mode=1 means for message persistence.

Configuration
advanced
2:00remaining
Correct queue declaration for durable message persistence

Which RabbitMQ queue declaration ensures messages are durable and survive broker restarts?

RabbitMQ
channel.queue_declare(queue='task_queue', durable=___)
ATrue
BFalse
CNone
D0
Attempts:
2 left
💡 Hint

Durable queues require a specific boolean value.

🔀 Workflow
advanced
2:00remaining
Ensuring message persistence in a RabbitMQ workflow

Which sequence of steps correctly ensures that messages are persistent and survive RabbitMQ restarts?

ADeclare queue with durable=True, publish messages with delivery_mode=2, restart broker
BDeclare queue with durable=True, publish messages with delivery_mode=1, restart broker
CDeclare queue with durable=False, publish messages with delivery_mode=2, restart broker
DDeclare queue with durable=False, publish messages with delivery_mode=1, restart broker
Attempts:
2 left
💡 Hint

Both queue and message must be durable for persistence.

Troubleshoot
expert
2:00remaining
Diagnosing lost messages despite durable queue and persistent messages

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?

AThe messages were published with the wrong routing key.
BThe messages were consumed before the restart, so none remained.
CThe RabbitMQ server was not properly restarted.
DThe queue was declared after messages were published, so it was recreated as non-durable.
Attempts:
2 left
💡 Hint

Consider the timing of queue declaration relative to message publishing.