In this project, I have implemented several design patterns commonly used in microservices architecture
Design Pattern | Tools |
---|---|
Service Discovery | Spring Cloud Netflix |
API Gateway | Spring Cloud Gateway |
Circuit Breaker | Resilience4j |
Distributed Messaging System | Apache Kafka |
-
Clone the repository.
- Run the below command to download the code from Github repository to your local machine.
git clone https://github.com/shaikrasheed99/kotlin-ecommerce-microservices.git
- Run the below command to move to the application directory.
cd kotlin-ecommerce-microservices
- Run the below command to download the code from Github repository to your local machine.
-
Make sure your machine has docker installed in it.
- Make sure your terminal is in
kotlin-ecommerce-microservices
directory. - Run the below command to start the Zookeeper, Kafka broker & Kafdrop containers.
docker compose up -d
- Make sure your terminal is in
-
Build & Start each service.
- Before starting any service, make sure your postgresql database in your local is started.
- Open a new terminal and execute the below command to start all the services at once.
-
./start-all-services.sh
- Execute the below command to stop all the services at once.
-
./stop-all-services.sh
Services Health API to validate Expected success response Order Service Postman - http://localhost:8081/actuator/health
Status - 200 & Body - { "status": "UP" }
Product Service Postman - http://localhost:8082/actuator/health
Status - 200 & Body - { "status": "UP" }
Inventory Service Postman - http://localhost:53391/actuator/health
Status - 200 & Body - { "status": "UP" }
Notification Service Postman - http://localhost:8083/actuator/health
Status - 200 & Body - { "status": "UP" }
API Gateway Postman - http://localhost:8080/actuator/health
Status - 200 & Body - { "status": "UP" }
Discovery Server Browser - http://localhost:8761/
You must see Spring Eureka
default UIKaf Drop Browser - http://localhost:9000/
You must see Kafdrap
default UI