Skip to content

Producer consumer microservice tutorial with Spring Boot and ActiveMQ Artemis.

Notifications You must be signed in to change notification settings

francescofiora/tasks

Repository files navigation

Tasks

Producer consumer microservice tutorial with Spring Boot and ActiveMQ Artemis.

Topics covered

  • 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

Getting Started

Compile

./gradlew clean build

Dependency-Check

./gradlew dependencyCheckAnalyze --info

Pitest

./gradlew pitest

Reports

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

SonarQube

Run SonarQube

docker-compose -f docker_dev/docker-compose-sonar.yml up

For SonarQube configuration follow this link: Try Out SonarQube

Scan project

./gradlew sonarqube \
-Dsonar.projectKey=yourProjectKey \
-Dsonar.login=yourAuthenticationToken

Create artemis-debian image

Using Docker for tests

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

Execute applications

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

Debug Support

java -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y -jar task-executor/build/libs/task-executor-1.0-SNAPSHOT.jar

System Integration Test environment

Create Docker images

./gradlew jibDockerBuild

Manual tests - execute all applications with Docker

docker-compose -f docker/docker-compose.yml up

Manual tests - Prometheus with Docker

docker-compose -f docker/docker-compose-metrics.yml up

Integration Test

cd task-integration-test/
./gradlew clean build

Technologies used

About

Producer consumer microservice tutorial with Spring Boot and ActiveMQ Artemis.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages