HandsOn: Create Queue in RabbitMQ using Management UI and Command Line rabbitmqctl

Hands-On: Create a Queue in RabbitMQ

Using RabbitMQ Management UI

    Adding Queue using RabbitMQ Management UI Tab
  1. Access the Web UI: Open your web browser and go to the RabbitMQ Management Web UI. The default URL is http://localhost:15672, but this might vary depending on your setup.
  2. Log In: Enter your username and password. The default credentials are often guest for both fields.
  3. Navigate to the Queues Section: Click on the "Queues and Streams" tab in the top menu.
  4. Create a New Queue: Expand the "Add a new queue" section.
  5. Fill in Queue Details:
    • Queue Name: Enter a name for your queue.
    • Durable: Check this if you want the queue to survive server restarts.
    • Auto-delete: Check this if you want the queue to be deleted when no consumers are connected.
    • Arguments: You can add additional arguments if needed.
  6. Create the Queue: Click the "Add Queue" button to create your queue.


Using RabbitMQ Command-Line Tool (rabbitmqctl)

  1. Open Terminal: Open a terminal or command prompt on the machine where RabbitMQ is installed.
  2. Run the Create Queue Command: Use the following command to create a queue:
    rabbitmqctl add_queue <queue_name> --durable --auto_delete
    Replace <queue_name> with the name you want for your queue. Add --durable if you want the queue to survive server restarts and --auto_delete if you want the queue to be deleted when no consumers are connected. Adjust these options as needed.
  3. Verify the Queue: To list all queues and verify your new queue, use:
    rabbitmqctl list_queues


Some points to Note:

  • Queue Options: Ensure you understand the options you are setting for durability and auto-deletion based on your use case.
  • Permissions: Make sure you have the necessary permissions to create queues.

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!