Template for applications based on Spring Boot and RabbitMQ
- Default configuration for RabbitMQ
- Integration testing using
spring-rabbit-test
andqpid
as in-memory AMQP broker - Sleuth support to propagate correlation information between endpoints
- JDK 1.8
- Download and install Lombok plugin
- Enable Annotation Processors
- Go to Setting->Build, Execution, Deployment-> Compiler->Annotation Processors
- Check Enable annotation processing
2 things are required - running RabbitMQ instance and properly configured .env
file
Most simple way to get RabbitMQ up and running is to use docker:
docker run -d -p 5672:5672 -p 15672:15672 rabbitmq
Or just run it with docker-compose
:
docker-compose up
Ensure that .env
file has the following content:
rabbitmq.host=localhost
rabbitmq.port=5672
rabbitmq.username=guest
rabbitmq.password=guest
rabbitmq.virtual-host=/
rabbitmq.use-ssl=false
Either run it as command-line application lv.ctco.tpl.rabbitmq.Application
or run gradlew bootRun
from command line
gradlew build
gradlew test
- Spring Boot : Application framework
- Lombok : Utility library for Java language
- RabbitMQ : Message broker
- Sleuth : Distributed tracing solution