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

Initiating Queue/Exchange Configuration in RabbitMQ
Devprime-based microservices automatically connect to Stream services such as RabbitMQ.

  1. Open Rabbitmq in the browser at http://localhost:15672
  2. Use the default guest/guest username and password
  3. Go to the Queue menu > Add a new queue > “orderevents”
    Configuring queues in RabbitMQ
  4. Repeat the step in item 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
    Configuring queues in RabbitMQ
  7. Enter the name “Devprime” and add the new exchange
  8. Now we are going to 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” in “to queue” and in “Routing key” and then click on Bind.
    Configuring queues in RabbitMQ
  10. Repeat step 9 and add “paymentevents” to “to queue” and “Routing key” and then click Bind.
    Configuring queues in RabbitMQ

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

Last modified August 20, 2024 (2f9802da)