Bird
Raised Fist0
RabbitMQdevops~20 mins

Quorum queues (recommended) in RabbitMQ - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Quorum Queue Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Quorum Queue Replication
In RabbitMQ, what is the main difference between a quorum queue and a classic mirrored queue regarding message replication?
AQuorum queues replicate messages using the Raft consensus algorithm, ensuring strong consistency, while classic mirrored queues replicate asynchronously without consensus.
BQuorum queues replicate messages asynchronously without consensus, while classic mirrored queues use Raft for strong consistency.
CNeither quorum nor classic mirrored queues replicate messages; replication is handled by external plugins.
DBoth quorum and classic mirrored queues use the Raft consensus algorithm for replication.
Attempts:
2 left
💡 Hint
Think about how quorum queues ensure data safety and consistency.
💻 Command Output
intermediate
2:00remaining
Queue Declaration Output
What is the output of the following RabbitMQ CLI command when declaring a quorum queue named 'task_queue'? rabbitmqctl add_queue --quorum task_queue
RabbitMQ
rabbitmqctl add_queue --quorum task_queue
AError: unknown command 'add_queue'
BQueue 'task_queue' declared as quorum queue
CQueue 'task_queue' declared as classic mirrored queue
DCommand executed successfully with no output
Attempts:
2 left
💡 Hint
Check the correct RabbitMQ CLI command for declaring queues.
❓ Configuration
advanced
2:00remaining
Configuring a Quorum Queue Policy
Which of the following JSON policy definitions correctly sets all queues with names starting with 'q_' to be quorum queues in RabbitMQ?
A{"pattern":"q_*","definition":{"queue-type":"classic"},"priority":0,"apply-to":"queues"}
B{"pattern":"^q_","definition":{"ha-mode":"all"},"priority":0,"apply-to":"queues"}
C{"pattern":"^q_","definition":{"queue-type":"quorum"},"priority":0,"apply-to":"queues"}
D{"pattern":"^q_","definition":{"queue-type":"quorum"},"priority":10,"apply-to":"exchanges"}
Attempts:
2 left
💡 Hint
Look for the correct pattern, queue-type, and apply-to fields.
❓ Troubleshoot
advanced
2:00remaining
Diagnosing Quorum Queue Node Failure
A quorum queue with 3 nodes loses one node unexpectedly. What is the expected behavior of the queue after this failure?
AThe quorum queue stops accepting messages until the failed node is restored.
BThe quorum queue switches to classic mirrored mode automatically.
CThe quorum queue loses all messages and deletes itself automatically.
DThe quorum queue continues operating normally with the remaining 2 nodes, maintaining data availability.
Attempts:
2 left
💡 Hint
Consider how quorum queues handle node failures with Raft consensus.
✅ Best Practice
expert
3:00remaining
Choosing Queue Type for High Availability
For a critical messaging system requiring strong consistency and automatic recovery from node failures, which queue type and configuration is the best practice in RabbitMQ?
AUse classic mirrored queues with ha-mode set to 'all' and manual failover.
BUse quorum queues with at least 3 nodes and enable automatic leader election.
CUse classic queues without mirroring and rely on client retries.
DUse quorum queues with a single node to reduce complexity.
Attempts:
2 left
💡 Hint
Think about consistency, fault tolerance, and automation.

Practice

(1/5)
1. What is the main purpose of a quorum queue in RabbitMQ?
easy
A. To replicate messages across multiple nodes for safety
B. To speed up message delivery by using a single node
C. To store messages only on disk without replication
D. To limit the number of messages in the queue

Solution

  1. Step 1: Understand quorum queue purpose

    Quorum queues replicate messages to multiple nodes to ensure safety and durability.
  2. Step 2: Compare options

    Only To replicate messages across multiple nodes for safety describes replication for safety, which is the main feature of quorum queues.
  3. Final Answer:

    To replicate messages across multiple nodes for safety -> Option A
  4. Quick Check:

    Quorum queue purpose = replication for safety [OK]
Hint: Quorum queues replicate messages for safety [OK]
Common Mistakes:
  • Thinking quorum queues speed up delivery instead of ensuring safety
  • Confusing quorum queues with simple disk storage
  • Assuming quorum queues limit message count
2. Which is the correct way to declare a quorum queue in RabbitMQ using the CLI?
easy
A. rabbitmqadmin declare queue name=myqueue durable=true arguments={"x-queue-type":"quorum"}
B. rabbitmqadmin declare queue name=myqueue durable=true
C. rabbitmqctl add_queue myqueue x-queue-type=classic
D. rabbitmqctl add_queue myqueue durable=true

Solution

  1. Step 1: Identify quorum queue declaration syntax

    Quorum queues require setting the argument "x-queue-type" to "quorum" when declaring the queue.
  2. Step 2: Check options for correct syntax

    Only rabbitmqadmin declare queue name=myqueue durable=true arguments={"x-queue-type":"quorum"} uses the correct syntax with rabbitmqadmin and sets the argument properly.
  3. Final Answer:

    rabbitmqadmin declare queue name=myqueue durable=true arguments={"x-queue-type":"quorum"} -> Option A
  4. Quick Check:

    Quorum queue declaration = set x-queue-type to quorum [OK]
Hint: Set x-queue-type to quorum in queue arguments [OK]
Common Mistakes:
  • Using rabbitmqctl add_queue which is not a valid command
  • Not setting x-queue-type argument
  • Using classic queue type instead of quorum
3. Given the following command, what will be the type of the queue created?
rabbitmqadmin declare queue name=test durable=true arguments={"x-queue-type":"quorum"}
medium
A. Classic queue
B. Lazy queue
C. Priority queue
D. Quorum queue

Solution

  1. Step 1: Analyze the queue declaration command

    The command sets the argument "x-queue-type" to "quorum", which specifies the queue type.
  2. Step 2: Determine queue type from argument

    Setting "x-queue-type" to "quorum" creates a quorum queue.
  3. Final Answer:

    Quorum queue -> Option D
  4. Quick Check:

    Queue type argument = quorum [OK]
Hint: Check x-queue-type argument value for queue type [OK]
Common Mistakes:
  • Assuming default classic queue without checking arguments
  • Confusing quorum with lazy or priority queues
  • Ignoring the arguments field
4. You tried to create a quorum queue but got an error. Which of these is the most likely cause?
medium
A. You declared the queue with a name longer than 10 characters
B. You set durable to false
C. You forgot to set the argument x-queue-type to quorum
D. You used the command rabbitmqctl add_queue

Solution

  1. Step 1: Identify required argument for quorum queues

    Quorum queues require the argument "x-queue-type" set to "quorum"; missing this causes errors.
  2. Step 2: Evaluate other options

    Durability false is allowed, rabbitmqctl add_queue is invalid command but not the main cause, and queue name length is not restricted to 10 characters.
  3. Final Answer:

    You forgot to set the argument x-queue-type to quorum -> Option C
  4. Quick Check:

    Missing x-queue-type=quorum causes error [OK]
Hint: Always set x-queue-type=quorum for quorum queues [OK]
Common Mistakes:
  • Assuming durability must be true
  • Using invalid rabbitmqctl commands
  • Believing queue name length causes errors
5. You want to ensure your important messages are never lost even if a RabbitMQ node crashes. Which queue type and setting should you use?
hard
A. Classic queue with durable=false
B. Quorum queue with x-queue-type set to quorum and durable=true
C. Lazy queue with auto-delete=true
D. Classic queue with exclusive=true

Solution

  1. Step 1: Identify queue type for message safety

    Quorum queues replicate messages across nodes, protecting against node crashes.
  2. Step 2: Check durability setting

    Durable=true ensures messages survive broker restarts, important for message safety.
  3. Step 3: Evaluate other options

    Classic queues with durable=false or exclusive=true do not guarantee safety; lazy queues with auto-delete=true remove queues automatically.
  4. Final Answer:

    Quorum queue with x-queue-type set to quorum and durable=true -> Option B
  5. Quick Check:

    Quorum + durable=true = message safety [OK]
Hint: Use quorum queue with durable=true for safety [OK]
Common Mistakes:
  • Using classic queues without durability
  • Confusing lazy or exclusive queues with safety features
  • Ignoring durable setting
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard