This project is a Microservices-based Employee and Department Management System developed using Spring Boot and Spring Cloud. It demonstrates modern microservice architecture concepts such as Service Discovery, API Gateway, Centralized Configuration, Load Balancing, Distributed Tracing, Monitoring, and Inter-Service Communication.
- Employee Service
- Department Service
- Service Discovery using Eureka Server
- Centralized Configuration using Config Server
- API Gateway for request routing
- OpenFeign for Inter-Service Communication
- Client-Side Load Balancing
- Distributed Tracing using Zipkin
- Monitoring using Spring Boot Admin
- MySQL Database Integration
-
I implemented a getFullDetails endpoint in the Employee Service.
-
The endpoint accepts an Employee ID.
-
Employee Service fetches the employee details from its database.
-
It extracts the Department ID from the employee record.
-
Using OpenFeign Client, the Department ID is sent to Department_OpenClient.
-
Department Service returns the department details.
-
Finally, Employee Service combines both Employee and Department information into a single response.
-
This demonstrates real-world Microservice-to-Microservice Communication using OpenFeign and Service Discovery through Eureka.
Client Request
↓
API Gateway
↓
Employee Service
↓
Department Service
- Config Server
- Eureka Server
- Spring Boot Admin
- Zipkin Server
- MySQL Database
- Java 21
- Spring Boot
- Spring Cloud
- Spring Data JPA
- OpenFeign
- Maven
- MySQL
- Spring Boot Admin
- Zipkin
- Eureka Server
- Config Server
Responsibilities:
- Save Employee
- Get Employee By Id
- Get Employee with Department Details
Endpoints:
GET /employee/getById/{id}
GET /employee/getFullDetails/{id}
POST /employee/save
Responsibilities:
- Save Department
- Get Department By Id
Endpoints:
GET /department/get/{id}
POST /department/save
Routes all requests to the respective microservices.
Examples:
GET /employee/getById/{id}
GET /employee/getFullDetails/{id}
GET /department/get/{id}
All services register themselves with Eureka Server.
Registered Services:
- API-GATEWAY
- EMPLOYEE-SERVICE
- DEPARTMENT-SERVICE
Multiple instances of services can be started.
Department Service Instances:
- 8080
- 8081
- 8082
Employee Service Instances:
- 9090
- 9091
- 9092
Requests are distributed automatically using Spring Cloud Load Balancer.
OpenFeign is used for communication between Employee Service and Department Service.
Example Flow:
Employee Service → OpenFeign Client → Department Service
Spring Boot Admin provides:
- Service Health Status
- Metrics Monitoring
- Application Details
- Environment Information
Zipkin is used to trace requests across multiple microservices.
Request Flow:
API Gateway
↓
Employee Service
↓
Department Service
All service configurations are maintained centrally using Config Server and Git Repository.
Benefits:
- Centralized Configuration
- Dynamic Updates
- Environment Management
Srinivas Dappu Java Full Stack Developer LinkedIn: https://www.linkedin.com/in/dappusrinivas/