Using RabbitMQ

RabbitMQ is the most widely deployed open source message broker.

Creating a container with RabbitMQ
docker run --name rabbitmq -d -p 5672:5672 -p 15672:15672 -t rabbitmq:3-management

Starting Queue/Exchange Setup in RabbitMQ
Devprime-based microservices automatically connect to Stream services like RabbitMQ.

  1. Open Rabbitmq in your browser at http://localhost:15672
  2. Use the default guest username and password/guest
  3. Go to the Queue menu > Add a new queue > “orderevents”
    Setting up queues in RabbitMQ
  4. Repeat step 3 and add “paymentevents”
  5. The next step will be to create an Exchange called “Devprime”
  6. Go to the Exchanges menu and locate the “Add a new exchange” option
    Setting up queues in RabbitMQ
  7. Enter the name “Devprime” and add the new exchange
  8. Now let’s bind and link the “Devprime” exchange with the “orderevents” and “paymentevents” queues.
  9. Click on the “Devprime” exchange and locate the Bindings option and add “orderevents” under “to queue” and under “Routing key” and then click on Bind.
    Setting up queues in RabbitMQ
  10. Repeat step 9 and add “paymentevents” under “to queue” and “Routing key” and then click on Bind.
    Setting up queues in RabbitMQ

The names of queues or topics are used in Devprime examples. Throughout the projects, you’ll define other names as you need them, as well as other settings, such as a fanout exchange.

Last modified January 10, 2024 (967dcac3)