RabbitMQ is a popular open source message broker written in Erlang. It uses a protocol called the Advanced Message Queueing Protocol (AMQP) in order to pass messages through its queueing system. Without further ado, let's set up a RabbitMQ instance and pass messages to and from it using Go:
- First, we need to start up a RabbitMQ instance using Docker:
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
- Then, we have a RabbitMQ instance, complete with the management portal, running on our host.
- Now, we can use the Go AMQP library (https://github.com/streadway/amqp) in order to pass messages to and from our RabbitMQ system with Go.
We will start by creating a listener. Let's see this procedure step by ...