This project is a microservices-based application built using Spring Boot, Spring Cloud, and Maven. It consists of the following components:
- Eureka Server: Service registry for microservices.
- Gateway Microservice: API Gateway for routing requests to the appropriate microservices.
- Customer Microservice: Manages customer-related operations.
- Flight Microservice: Manages flight-related operations.
- Other Microservices: Includes Booking and Notification services.
- Eureka Server: Acts as the service registry where all microservices register themselves.
- Gateway Microservice: Routes requests to the appropriate microservices using service discovery via Eureka.
- Microservices: Each microservice (Customer, Flight, etc.) performs specific business logic and communicates with other services via REST APIs.
- Gateway connects to all microservices via Eureka using service names.
- Microservices register themselves with Eureka for service discovery.
- Database: Each microservice (e.g., Customer, Flight) connects to its own database.
- Java 17
- Maven
- MySQL (or any configured database)
- IDE (e.g., IntelliJ IDEA)
- Navigate to the
eurekamodule. - Run the
EurekaApplicationclass. - Verify that the Eureka dashboard is accessible at
http://localhost:8761.
- Navigate to the
gatewayMSmodule. - Run the
GatewayMsApplicationclass. - The Gateway will be accessible at
http://localhost:8080.
- Customer Microservice:
- Navigate to the
customermodule. - Run the
CustomerApplicationclass.
- Navigate to the
- Flight Microservice:
- Navigate to the
flightmodule. - Run the
FlightApplicationclass.
- Navigate to the
- Repeat the above steps for other microservices (e.g., Booking, Notification).
- Open the Eureka dashboard (
http://localhost:8761) and ensure all services are registered. - Use the Gateway (
http://localhost:8080) to access the microservices:http://localhost:8080/customer/**http://localhost:8080/flight/**- Other routes as defined in the Gateway.
- Eureka Server (Service Registry)
- Gateway Microservice (API Gateway)
- Each Microservice (Customer, Flight, etc.)
- Customer Microservice:
GET /customer/customer/{id}: Fetch customer by ID.
- Flight Microservice:
GET /flight/flight/{id}: Fetch flight by ID.
- Ensure the database is running and configured correctly for each microservice.
- Use
application.propertiesorapplication.ymlto configure database connections and Eureka settings. - Use Postman or any REST client to test the APIs.
- If a service fails to register with Eureka, check the Eureka server URL in the
application.propertiesof the microservice. - Ensure all required dependencies are included in the
pom.xmlfiles.