/springboot-microservice

Spring boot version 3 microservice example

Primary LanguageJavaMIT LicenseMIT

Spring boot 3 microservice with Spring cloud

The project is microservice development using spring boot 3 along with below components

Sonar Cloud

Quality Gate Status

Github Action

Github workflow

Code Coverage

Coverage

Bug

Bugs

Features

  • Eureka Service Registry
  • Spring cloud config server
  • Spring cloud Gateway
  • Spring Webclient(Fluent API)
  • Distributed tracing with Zipkin
  • Unit testing with Mockito Junit Jupiter
  • Code coverage with Jacoco

Installation

Docker

go to root directory and execute below command

docker-compose up -d

Maven

Go to the respective project directory in each project and execute below command

./mvnw spring-boot:run

API Reference

Add department

  POST /department/add
Parameter Type Description
id string Required. department id
name string Required. department name

Add employee

  POST /employee/add
Parameter Type Description
id string Required. employee id
departmentId string Required. department id
firstName string Required. employee first name
lastName string employee last name
dateOfBirth string employee date of birth

GET department

  GET /department/{id}
Parameter Type Description
id string Required. department id

GET employee

  GET /employee/{id}
Parameter Type Description
id string Required. employee id

GET all department

  GET /department/all

GET employee by departmentId

  GET /employee/department/{id}
Parameter Type Description
id string Required. department id

GET all department and employees

  GET /department/all/department-employee

Code Coverage

Run below commands to generate code coverage reports clean jacoco:prepare-agent install jacoco:report

Blog

step by step explation of project development

https://www.devhabit.org/post/spring-boot-3-microservice-spring-cloud