This project aims to present how to create and configure a Spring Boot + RabbitMQ application. The project is built using Java, Spring Boot, RabbitMQ and Docker.
- Java JDK version 8+
- Docker Desktop
Library name | Description |
---|---|
Spring Boot 2 | Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run". |
RabbitMQ | RabbitMQ is the most widely deployed open source message broker. |
Docker Compose | Compose is a tool for defining and running multi-container Docker applications. |
## Run RabbitMQ on Docker
docker-compose up -d
## Build and run publisher application using Maven Wrapper
mvnw.cmd -f rabbitmq-publisher/pom.xml clean install spring-boot:run
## Build and run receiver application using Maven Wrapper
mvnw.cmd -f rabbitmq-receiver/pom.xml clean install spring-boot:run
## Run RabbitMQ on Docker
docker-compose up -d
## Build and run publisher application using Maven Wrapper
./mvnw -f rabbitmq-publisher/pom.xml clean install spring-boot:run
## Build and run receiver application using Maven Wrapper
./mvnw -f rabbitmq-receiver/pom.xml clean install spring-boot:run
RabbitMQ URL | Username | Password |
---|---|---|
http://localhost:15672 | admin | admin |
In order to send a message to the queue please send a request:
curl --header "Content-Type: application/json" --request POST --data "{\"firstName\":\"John\",\"lastName\":\"Black\"}" http://localhost:8080/api/messages