A comprehensive microservices architecture implementation using Spring Boot, Spring Cloud, and related technologies.
This project demonstrates a complete microservices ecosystem with service discovery, configuration management, API gateway, distributed tracing, and security features.
- Employee Service - Manages employee information and operations
- Employee Payroll Service - Handles payroll calculations and management
- Role Service - Manages user roles and permissions
- Eureka Naming Server - Service discovery and registration
- Spring Cloud Config Server - Centralized configuration management
- Spring Cloud Gateway Server - API gateway for routing and load balancing
- Micrometer Tracing - Distributed tracing and monitoring
- Java 17
- Spring Boot 3.2.5
- Spring Cloud 2023.0.1
- Gradle - Build tool and dependency management
- H2 Database - In-memory database for development
- Eureka - Service discovery
- Spring Cloud Gateway - API gateway
- Micrometer Tracing - Distributed tracing
- Spring Security - Authentication and authorization
- Resilience4j - Circuit breaker pattern
- SpringDoc OpenAPI - API documentation
msa-upgraded/
├── build.gradle # Parent build configuration
├── settings.gradle # Gradle settings
├── README.md # This file
├── employee-payroll-service/ # Payroll management service
├── employee-service/ # Employee management service
├── eureka-naming-server/ # Service discovery server
├── role-service/ # Role management service
├── spring-cloud-config-server/ # Configuration server
├── micrometer-tracing/ # Distributed tracing server
└── spring-cloud-gateway-server/ # API gateway
- Java 17 or higher
- Gradle 8.0 or higher (or use provided wrapper)
# Build all modules
./gradlew clean build
# Build specific module
./gradlew :employee-service:clean :employee-service:build
# Skip tests during build
./gradlew clean build -x test
-
Start Infrastructure Services (in order):
# Start Eureka Server cd eureka-naming-server ../gradlew bootRun # Start Config Server cd ../spring-cloud-config-server ../gradlew bootRun # Start Tracing (optional) cd ../micrometer-tracing ../gradlew bootRun
-
Start Business Services:
# Start Employee Service cd ../employee-service ../gradlew bootRun # Start Payroll Service cd ../employee-payroll-service ../gradlew bootRun # Start Role Service cd ../role-service ../gradlew bootRun
-
Start Gateway:
cd ../spring-cloud-gateway-server ../gradlew bootRun
Once all services are running, you can access:
- Eureka Dashboard: http://localhost:8761
- Spring Cloud Gateway: http://localhost:8765
- Micrometer Tracing Dashboard: http://localhost:9411
- Config Server: http://localhost:8888
All services use Spring Cloud Config for centralized configuration. Configuration files are located in the spring-cloud-config-server module.
Services use H2 in-memory database by default. The database console is available at:
- Employee Service: http://localhost:8080/h2-console
- Payroll Service: http://localhost:8081/h2-console
- Role Service: http://localhost:8082/h2-console
Default credentials:
- URL:
jdbc:h2:mem:testdb - Username:
sa - Password: (empty)
# Run all tests
./gradlew test
# Run tests for specific module
./gradlew :employee-service:test
# Run integration tests
./gradlew check- Micrometer Tracing provides distributed tracing across microservices
- Spring Boot Actuator endpoints expose health and metrics information
- Eureka provides service discovery and health monitoring
Each service exposes RESTful APIs. You can explore the APIs using:
- Swagger UI (if configured)
- Postman collections
- Direct HTTP requests
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
This project is for educational and demonstration purposes.
For questions or issues, please refer to the individual service documentation or create an issue in the repository.