Integrating RabbitMQ and Laravel(1/5): Deployment using Docker
Hello, in this series of 5 posts I will show how to integrate RabbitMQ and Laravel.
RabbitMQ is an open source message brokering software (sometimes called message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP). The RabbitMQ server is written in the Erlang programming language. Client libraries for interacting with the broker are available for all major programming languages (including PHP).
Source: https://www.rabbitmq.com/documentation.html
As everything in life, it is necessary to start from the basics, so we are deploying a Docker container with the official RabbitMQ image.
Instalation and deployment
- Access the link: https://hub.docker.com/_/rabbitmq
- We open a terminal in our operating system.
- We copy and paste the command to download the docker image:
docker pull rabbitmq
4. Run the docker command:
docker run -d --hostname my-rabbit --name some-rabbit -p 8080:15672 -p 5672:5672 rabbitmq:3-management
Command 4 contains: the hostname for our server will be my-rabbit, the container name will be some-rabbit, finally we expose port 15672 via port 8080 and enable the web console. We will use the web console in the next entry in order to test a demo queue.
5. We open our web browser and access:
6. We use the default username and password:
user: guest
password: guest
After entering the default username and password, we will access the web console. In the console we can see the node name, data such as memory and disk space.
We already have RabbitMQ enabled and using a Docker container, in the next post we will see how to create a demo queue and send messages.