Producer consumer microservice tutorial with Spring Boot and ActiveMQ Artemis.
- Spring Boot Rest Api
- Spring Boot Batch
- Spring Cloud Netflix
- SSL connections
- JMS(Java Message Service)
- Swagger UI for visualizing APIs
- Error Handling
- Basic Authentication
- Mapper for POJO<->DTO
- Logging
- Testing
- Repositories using DataJpaTest
- Repositories using DataMongoTest
- Services using Mockito
- EndPoints using WebMvcTest
- Pojos and Dtos using OpenPojo
- Integration test using TestContainers
- Monitoring
- Netflix Eureka service
- Prometheus
./gradlew clean build
./gradlew dependencyCheckAnalyze --info
./gradlew pitest
task-api/build/reports/checkstyle/main.html
task-api/build/reports/checkstyle/test.html
task-api/build/reports/tests/test/index.html
task-api/build/reports/jacoco/test/html/index.html
task-api/build/reports/dependency-check-report.html
task-api/build/reports/pitest/index.html
task-executor/build/reports/checkstyle/main.html
task-executor/build/reports/checkstyle/test.html
task-executor/build/reports/tests/test/index.html
task-executor/build/reports/jacoco/test/html/index.html
task-executor/build/reports/dependency-check-report.html
task-executor/build/reports/pitest/index.html
task-message/build/reports/checkstyle/main.html
task-message/build/reports/checkstyle/test.html
task-message/build/reports/tests/test/index.html
task-message/build/reports/jacoco/test/html/index.html
task-message/build/reports/dependency-check-report.html
task-message/build/reports/pitest/index.html
task-eureka/build/reports/checkstyle/main.html
task-eureka/build/reports/checkstyle/test.html
task-eureka/build/reports/tests/test/index.html
task-eureka/build/reports/jacoco/test/index.html
Run SonarQube
docker-compose -f docker_dev/docker-compose-sonar.yml up
- Sonarqube (http://localhost:9000/)
For SonarQube configuration follow this link: Try Out SonarQube
Scan project
./gradlew sonarqube \
-Dsonar.projectKey=yourProjectKey \
-Dsonar.login=yourAuthenticationToken
-
Download Apache Artemis (https://activemq.apache.org/components/artemis/download/) tar xvzf apache-artemis-2.20.0-bin.tar.gz apache-artemis-2.20.0
-
Download files from (https://github.com/apache/activemq-artemis/tree/master/artemis-docker)
./prepare-docker.sh apache-artemis-2.20.0 cd apache-artemis-2.20.0 chmod +x docker/docker-run.sh docker build -f ./docker/Dockerfile-debian -t artemis-debian .
-
Check image created
docker image ls artemis-debian
There is a docker compose file to run MySql, phpMyAdmin, ActiveMQ Artemis, MongoDb and Mongo Express.
docker-compose -f docker_dev/docker-compose.yml up
java -jar task-eureka/build/libs/task-eureka-1.0-SNAPSHOT.jar
java -jar task-api/build/libs/task-api-1.0-SNAPSHOT.jar
java -jar task-executor/build/libs/task-executor-1.0-SNAPSHOT.jar
Links
- http://localhost:8081/swagger-ui.html (Tasks-Api Swagger)
- http://localhost:8081/actuator (Tasks-Api /info,/health,/jolokia)
- http://localhost:8082/swagger-ui.html (Tasks-Executor Swagger)
- http://localhost:8082/actuator (Tasks-Executor /info,/health,/jolokia)
- http://localhost:8080/ (PhpMyAdmin)
- http://localhost:8085/ (Mongo Express)
- http://localhost:8161/console/login (ActiveMQ)
- http://localhost:8761/ (Eureka)
- http://localhost:9000/ (Sonarqube)
java -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y -jar task-executor/build/libs/task-executor-1.0-SNAPSHOT.jar
./gradlew jibDockerBuild
docker-compose -f docker/docker-compose.yml up
docker-compose -f docker/docker-compose-metrics.yml up
cd task-integration-test/
./gradlew clean build
- Gradle 7.0
- Java 11
- Spring Boot 2.6
- Spring Batch 4.2
- Spring Security
- Swagger OpeApi 3.0
- Spring Cloud Netflix
- Micrometer Prometheus 1.9
- Mapstruct 1.4
- Lombok 1.18
- Spring Data JPA
- Spring Data MongoDb
- Mysql connector 8.0
- Spring JMS
- HsqlDb
- LogBack 1.2
- Mockito
- JUnit 5
- OpenPojo 0.9
- CheckStyle 8.44
- Owasp Dependency Check 6.2
- Jacoco 0.8
- Pitest 1.7
- Jolokia 1.7
- TestContainers 1.17