For further reference, please consider the following sections:
- Microservices using spring boot
- Implementation of open feign client
- Implementation of Eureka server and client
- Implementation of client based load balancing (Added in Student Service for Address Service)
- Implementation of Spring cloud API gateway
- Fault tolerance and circuit break with Resilience4j and Spring AOP.
- Distributed Tracing with Sleuth and Zipkin
- Spring cloud config server
- Rate Limiting via Resilience4j
- Monitoring via Prometheus and Grafana
- Setup and run mysql on local machine, then dump the data given in
helper-filesdirectory like
mysql -u root < helper-files/university.db.sql - Change database connection credentials everywhere in
application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/university
spring.datasource.username=root
spring.datasource.password=root_pass- Each microservices can be build and run by following maven command from the respective directory
# order of running -
eureka-server -> api-gateway -> config-server -> address-service (port 8081) -> address-service (port 8082) -> student-service
mvn spring-boot:run
- For all local request and testing you can use following postman collection via import option in Postman -
- Spring version used here is -
(╯°□°)╯︵ ┻━┻
:: Spring Boot :: (v2.7.1)- Have docker installed on your system first.
$ docker -v
Docker version 20.10.17, build 100c701- Run docker compose
$ docker-compose up --build- Check if everything runs good
$ docker container ls
IMAGE PORTS NAMES
grafana/grafana:latest 0.0.0.0:3000->3000/tcp spring-microservices-grafana-1
prom/prometheus:latest 0.0.0.0:9090->9090/tcp spring-microservices-prometheus-1
bindian0509/student-service:latest 0.0.0.0:8080->8080/tcp student-service
bindian0509/address-service:latest 0.0.0.0:8081->8081/tcp address-service-1
bindian0509/address-service:latest 0.0.0.0:8082->8081/tcp address-service-2
bindian0509/api-gateway:latest 0.0.0.0:8072->8072/tcp api-gateway
bindian0509/config-server:latest 0.0.0.0:8888->8888/tcp config-server
openzipkin/zipkin 9410/tcp, 0.0.0.0:9411->9411/tcp zipkin
bindian0509/eureka-server:latest 0.0.0.0:8761->8761/tcp eureka-server
mysql:5.7 0.0.0.0:3306->3306/tcp, 33060/tcp mysql