Minimal microservices example demo - using legacy Spring Cloud / Netflix OSS Project.
The project maintains two microservices, the department service and the user profile service. Each user profile can be linked to any department. The User Profile Service allows you to retrieve department data by calling the Department Service REST API and complete the profile data response with department information.
java 21, Maven 3, Spring Boot 2.7, Spring Cloud 2021.0.3 mongo:5.0, mysql:5.7.43, zipkin-slim:2.23.
Including utils: liquibase, WireMock, Mongodb & Mysql testcontainers, docker-compose.dev.yml, micrometer, checkstyle configuration, SpotBugs, PMD etc.
This sample project specifically demonstrates the following features using the Spring Cloud ecosystem.
- Service Registry
- Centralized Configuration
- (Client Side) Load Balancing
- Circuit Breaker pattern
Spring Cloud / Netflix OSS
Service/Feature | Spring Cloud Component | Netflix Component |
---|---|---|
Service Discovery | Spring Cloud Eureka | Eureka Server Eureka Client |
Circuit Breaker | Spring Cloud Hystrix | Hystrix Hystrix Dashboard |
Load Balancing | Spring Cloud Load Balancer | |
Centralized Configuration | Spring Cloud Config Server | |
Distributed Tracing | Spring Cloud Sleuth Spring Cloud Zipkin |
- Install Docker https://docs.docker.com/get-docker/ - at least 1.6.0
- Add new version of Docker Compose https://docs.docker.com/compose/install/
- Spin-up single instance of MongoDB, MySQL and Zipkin by running command:
docker compose -f compose.yaml up -d
The code follows Google Code Conventions. Code quality is measured by:
- Sonarqube
- PMD
- CheckStyle
- SpotBugs
This project has standard JUnit tests. To run them execute this command:
./mvnw verify -P use-testcontainers
Project uses a three-segment CalVer scheme, with a short year in the major version slot, short month in the minor version slot, and micro/patch version in the third and final slot.
YY.MM.MICRO
- YY - short year - 6, 16, 106
- MM - short month - 1, 2 ... 11, 12
- MICRO - "patch" segment