A comprehensive Spring Boot microservices project implementing a complete business ecosystem with API Gateway, Service Registry, and multiple domain-specific services.
This project demonstrates a modern microservices architecture using Spring Boot 3.0.2 and Spring Cloud, featuring:
- API Gateway with circuit breaker patterns
- Service Registry using Netflix Eureka
- Multiple Business Services with MySQL integration
- Inter-service Communication with RestTemplate
- Resilience Patterns for fault tolerance
service-registry- Netflix Eureka Server for service discoverycloud-gateway- Spring Cloud Gateway with circuit breaker patterns
company-service- Company management (CRUD operations)customer-service- Customer management with external API integrationtransaction-service- Transaction processing with customer service integrationsale-service- Sales management and trackinglisting-service- Product/service listing managementsubmission-service- Submission handling and processing
- Java 17
- Spring Boot 3.0.2
- Spring Cloud 2022.0.1
- Spring Cloud Gateway
- Netflix Eureka
- Spring Data JPA
- MySQL Database
- Lombok
- Maven
- Java 17 or higher
- Maven 3.6+
- MySQL Database
- IDE (IntelliJ IDEA, Eclipse, or VS Code)
git clone <repository-url>
cd Spring-MicroserviceCreate a MySQL database and update the connection properties in each service's application.properties file.
cd service-registry
./mvnw spring-boot:runService Registry will be available at: http://localhost:8761
# Company Service
cd company-service
./mvnw spring-boot:run
# Customer Service
cd customer-service
./mvnw spring-boot:run
# Transaction Service
cd transaction-service
./mvnw spring-boot:run
# Sale Service
cd sale-service
./mvnw spring-boot:run
# Listing Service
cd listing-service
./mvnw spring-boot:run
# Submission Service
cd submission-service
./mvnw spring-boot:runcd cloud-gateway
./mvnw spring-boot:runAPI Gateway will be available at: http://localhost:8080
All services are accessible through the API Gateway at http://localhost:8080:
GET /company- Get all companiesGET /company/{id}- Get company by IDPOST /company- Create new company
GET /customer- Get all customersGET /customer/{id}- Get customer by IDPOST /customer- Create new customer
GET /transaction- Get all transactionsGET /transaction/{id}- Get transaction by IDGET /transaction/seller/{sellerId}- Get transactions by sellerGET /transaction/customer/{customerId}- Get customer detailsPOST /transaction- Create new transaction
GET /sale- Get all salesGET /sale/{id}- Get sale by IDGET /sale/company/{companyId}- Get sales by companyGET /sale/consumer/{consumerId}- Get sales by consumerPOST /sale- Create new sale
GET /listing- Get all listingsGET /listing/{id}- Get listing by IDGET /listing/seller/{sellerId}- Get listings by sellerGET /listing/buyer/{buyerId}- Get listings by buyerPOST /listing- Create new listing
GET /submission- Get all submissionsGET /submission/{id}- Get submission by IDGET /submission/seller/{sellerId}- Get submissions by sellerGET /submission/buyer/{buyerId}- Get submissions by buyerPOST /submission- Create new submission
- Service Registry:
8761 - API Gateway:
8080 - Company Service:
8081 - Customer Service:
8082 - Transaction Service:
8083 - Sale Service:
8084 - Listing Service:
8085 - Submission Service:
8086
The API Gateway implements circuit breaker patterns for all services with fallback mechanisms to handle service failures gracefully.
- Eureka Dashboard:
http://localhost:8761- View registered services - API Gateway:
http://localhost:8080- Centralized API access point
Each service includes comprehensive test suites. Run tests using:
cd <service-name>
./mvnw testSpring-Microservice/
βββ cloud-gateway/ # API Gateway with routing and circuit breakers
βββ company-service/ # Company management service
βββ customer-service/ # Customer management service
βββ listing-service/ # Listing management service
βββ sale-service/ # Sales management service
βββ service-registry/ # Eureka service registry
βββ submission-service/ # Submission handling service
βββ transaction-service/ # Transaction processing service
βββ MicroService.postman_collection.json # API testing collection
βββ README.md
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- β Microservices Architecture
- β Service Discovery with Eureka
- β API Gateway with Load Balancing
- β Circuit Breaker Patterns
- β Database Integration (MySQL)
- β RESTful APIs
- β CORS Support
- β Comprehensive Error Handling
- β Postman Collection for Testing