Project developed with Spring, Docker and RabbitMQ. Two projects were created: the consumer (consumer) and a producer (producer). The consumer project will consume the messages from the queues and the producer project is responsible for creating the queues and their messages. Developed features:
- Standardization and creation and consumption of automatic queues;
- Creation of exception flow for the queues;
- Creation of automatic reprocessing of queues;
- Creation of established time for the execution of the reprocessing of the queues;
- Creation of endpoints in the API for sending messages and for executing the reprocessing of queues;
- RabbitMQ container creation in Docker
git clone https://github.com/RamonBecker/SpringRabbitMQ.git
git clone https://github.com/RamonBecker/SpringRabbitMQ.git
or install github https://desktop.github.com/
To test the end points you will need to install POSTMAN or Insomnia.
To send messages in RabbitMQ, open POSTMAN or Insomnia, choose the POST method and type the following:
localhost:8081/send
{
"text": "test"
}
To perform queue reprocessing in RabbitMQ, open POSTMAN or Insomnia, choose the GET method and type the following:
localhost:8082/repost
To install RabbitMQ in Docker container, open the windows cmd or linux terminal and type:
docker run -d -p 15672:15672 -p 5672:5672 --name rabbitmq rabbitmq-3-management
Once RabbitMQ is installed, you will need to enable the feature to move messages from one queue to another. For this you will need to enter the RabbitMQ bash, type in the terminal:
docker exec -it rabbitmq bash
Run the following command in bash:
rabbitmq-plugins enable rabbitmq_shovel rabbitmq_shovel_management
RabbitMQ has as default user:
username: guest
password: guest
If you want to change the default user, open your browser and enter the following address to enter the RabbitMQ user settings and make the changes you want:
http://localhost:15672/#/users/guest
If you change the default user, don't forget to change the application.yml project files:
spring:
rabbitmq:
username: your username changed
password: your password changed
To see the created queues and their messages:
Click on the queue name and go to the get Message(s) option
- Java
- Spring Boot
- Docker
- RabbitMQ
- Sending messages through queues
- Endpoint creation
By Ramon Becker 👋🏽 Get in touch!