0
0
RabbitMQdevops~20 mins

Queue length limits in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Queue Length Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding RabbitMQ queue length limits

What happens when a RabbitMQ queue reaches its configured max-length limit?

AThe oldest messages are dropped to make room for new messages.
BMessages are moved to a dead-letter queue immediately.
CRabbitMQ automatically creates a new queue to handle overflow.
DThe queue stops accepting new messages and blocks producers.
Attempts:
2 left
💡 Hint

Think about how RabbitMQ manages limited queue sizes to avoid blocking producers.

Configuration
intermediate
2:00remaining
Setting a max-length limit on a RabbitMQ queue

Which of the following commands correctly sets a max-length of 1000 messages on a queue named task_queue using rabbitmqctl?

Arabbitmqctl set_policy max_length_policy task_queue max-length=1000
Brabbitmqctl set_queue task_queue max-length=1000
Crabbitmqctl set_policy max_length_policy "^task_queue$" '{"max-length":1000}' --apply-to queues
Drabbitmqctl declare queue task_queue max-length=1000
Attempts:
2 left
💡 Hint

Policies are used to apply queue arguments like max-length in RabbitMQ.

💻 Command Output
advanced
2:00remaining
Interpreting queue length limit behavior

Given a queue with max-length set to 3, and the following sequence of published messages: msg1, msg2, msg3, msg4. What messages remain in the queue?

A["msg1", "msg2", "msg3", "msg4"]
B["msg1", "msg2", "msg3"]
C["msg3", "msg4"]
D["msg2", "msg3", "msg4"]
Attempts:
2 left
💡 Hint

Remember that the oldest messages are dropped when the max-length is exceeded.

Troubleshoot
advanced
2:00remaining
Diagnosing message loss with queue length limits

A developer notices that some messages are missing from a RabbitMQ queue configured with max-length. Which of the following is the most likely cause?

AThe queue's max-length limit caused the oldest messages to be dropped.
BRabbitMQ crashed and lost messages in memory.
CThe messages were consumed by a consumer faster than expected.
DThe messages were moved to a dead-letter queue due to TTL expiration.
Attempts:
2 left
💡 Hint

Consider what happens when the queue reaches its max-length.

Best Practice
expert
3:00remaining
Choosing queue length limit strategies for high-throughput systems

In a high-throughput RabbitMQ system, which queue length limit strategy helps prevent message loss while maintaining performance?

ASet a low <code>max-length</code> and rely on producers to retry on failure.
BSet a high <code>max-length</code> and use dead-letter exchanges to handle overflow.
CDisable <code>max-length</code> and allow unlimited queue growth.
DSet <code>max-length</code> to 1 to ensure only the latest message is kept.
Attempts:
2 left
💡 Hint

Think about balancing message retention and system stability.