Skip to content

srinivas6303/Employee-Department-Microservices-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Employee-Department Microservices System

Overview

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.

Features

  • 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

🔄 Inter-Service Communication Flow

  • 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.

Architecture

Client Request

API Gateway

Employee Service

Department Service

Supporting Components

  • Config Server
  • Eureka Server
  • Spring Boot Admin
  • Zipkin Server
  • MySQL Database

Tech Stack

Backend

  • Java 21
  • Spring Boot
  • Spring Cloud
  • Spring Data JPA
  • OpenFeign
  • Maven

Database

  • MySQL

Monitoring & Tracing

  • Spring Boot Admin
  • Zipkin

Service Discovery & Configuration

  • Eureka Server
  • Config Server

Microservices

Employee Service

Responsibilities:

  • Save Employee
  • Get Employee By Id
  • Get Employee with Department Details

Endpoints:

GET /employee/getById/{id}

GET /employee/getFullDetails/{id}

POST /employee/save

Department Service

Responsibilities:

  • Save Department
  • Get Department By Id

Endpoints:

GET /department/get/{id}

POST /department/save

API Gateway

Routes all requests to the respective microservices.

Examples:

GET /employee/getById/{id}

GET /employee/getFullDetails/{id}

GET /department/get/{id}

Service Discovery

All services register themselves with Eureka Server.

Registered Services:

  • API-GATEWAY
  • EMPLOYEE-SERVICE
  • DEPARTMENT-SERVICE

Load Balancing

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.

Inter-Service Communication

OpenFeign is used for communication between Employee Service and Department Service.

Example Flow:

Employee Service → OpenFeign Client → Department Service

Monitoring

Spring Boot Admin provides:

  • Service Health Status
  • Metrics Monitoring
  • Application Details
  • Environment Information

Distributed Tracing

Zipkin is used to trace requests across multiple microservices.

Request Flow:

API Gateway

Employee Service

Department Service

Configuration Management

All service configurations are maintained centrally using Config Server and Git Repository.

Benefits:

  • Centralized Configuration
  • Dynamic Updates
  • Environment Management

Author

Srinivas Dappu Java Full Stack Developer LinkedIn: https://www.linkedin.com/in/dappusrinivas/

About

This project is a Microservices-based Employee and Department Management System developed using Spring Boot and Spring Cloud.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages