0
0
RabbitMQdevops~30 mins

Mirrored queues for redundancy in RabbitMQ - Mini Project: Build & Apply

Choose your learning style9 modes available
Mirrored Queues for Redundancy in RabbitMQ
📖 Scenario: You are setting up a RabbitMQ message broker for a small company. To ensure messages are not lost if one server fails, you want to create a mirrored queue. This queue will copy messages to multiple servers automatically.
🎯 Goal: Learn how to create a mirrored queue in RabbitMQ by defining a policy that replicates the queue across nodes for redundancy.
📋 What You'll Learn
Create a queue named task_queue
Define a policy named ha-all to mirror task_queue across all nodes
Apply the policy with the correct pattern and arguments
Verify the policy is applied and the queue is mirrored
💡 Why This Matters
🌍 Real World
Mirrored queues ensure message safety in distributed systems by replicating messages across multiple servers. This prevents data loss if one server crashes.
💼 Career
Understanding mirrored queues is important for DevOps engineers managing message brokers in production environments to maintain high availability and fault tolerance.
Progress0 / 4 steps
1
Create the queue task_queue
Use the RabbitMQ command line tool to create a queue named task_queue on the default virtual host.
RabbitMQ
Need a hint?

Use rabbitmqadmin declare queue with name=task_queue and durable=true to create the queue.

2
Define a policy ha-all to mirror task_queue
Create a policy named ha-all that matches the queue task_queue and sets the argument ha-mode to all to mirror the queue on all nodes.
RabbitMQ
Need a hint?

Use rabbitmqctl set_policy with the name ha-all, pattern ^task_queue$, and argument {"ha-mode":"all"}.

3
Verify the policy is applied to task_queue
Use the RabbitMQ command line to list all policies and confirm that the policy ha-all is applied to task_queue.
RabbitMQ
Need a hint?

Use rabbitmqctl list_policies to see all policies and check for ha-all.

4
Show the final output confirming the policy
Run the command to list policies and print the output showing the ha-all policy applied to task_queue.
RabbitMQ
Need a hint?

The output should list the ha-all policy with pattern ^task_queue$ and argument {"ha-mode":"all"}.