This project demonstrates the implementation of microservices architecture using Spring Boot, Spring Cloud, Eureka for service discovery, and Feign for service communication. The project consists of four microservices: Quiz
, Question
, ApiGateway
, and ServiceRegistry
. Separate databases are used for the Question
and Quiz
services.
- Quiz Service: Manages quiz-related operations.
- Question Service: Handles questions and answers.
- ApiGateway: Routes requests and acts as the entry point for communication.
- ServiceRegistry: Registers and discovers microservices.
- Java 17
- Gradle
- Docker (optional for database containers)
Follow these steps to build and run the microservices:
cd quiz-service
./gradlew clean build
cd ../question-service
./gradlew clean build
cd ../api-gateway
./gradlew clean build
cd ../service-registry
./gradlew clean build
cd service-registry
./gradlew bootRun
cd ../quiz-service
./gradlew bootRun
cd ../question-service
./gradlew bootRun
cd ../api-gateway
./gradlew bootRun
- Endpoint:
/quiz/**
- Description: Manages quiz-related operations.
- Endpoint:
/question/**
- Description: Handles questions and answers.
- Endpoint:
/8765
- Description: Routes requests and serves as the entry point.
- Endpoint:
[/eureka](http://localhost:8761/)
- Description: Registers and discovers microservices.
The services communicate with each other using the Eureka service registry and Feign for client-side load balancing. The ApiGateway routes requests to the appropriate microservices based on the specified paths.