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.
- Open Rabbitmq in your browser at http://localhost:15672
- Use the default guest username and password/guest
- Go to the Queue menu > Add a new queue > “orderevents”
- Repeat step 3 and add “paymentevents”
- The next step will be to create an Exchange called “Devprime”
- Go to the Exchanges menu and locate the “Add a new exchange” option
- Enter the name “Devprime” and add the new exchange
- Now let’s bind and link the “Devprime” exchange with the “orderevents” and “paymentevents” queues.
- 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.
- Repeat step 9 and add “paymentevents” under “to queue” and “Routing key” and then click on Bind.
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)