A Spring Boot microservice that aggregates product prices from multiple external retailers (Amazon, Walmart, Flipkart).
| Part |
Description |
Status |
| Part1.md |
Basic Price Fetching (Phases 1-3) |
✅ |
| Part2.md |
Spring Boot Aggregator (REST API + WebClient) |
✅ |
| Part3.md |
Redis Caching Layer |
✅ |
| Part4.md |
Rate Limiting + Bulkheads (Resilience4j) |
✅ |
| Part5 |
Microservice Architecture |
🚧 |
| Part6 |
Event-Driven Updates (Kafka) |
🚧 |
| Part7 |
Highly Scalable Architecture |
🚧 |
./gradlew build
./gradlew bootRun
docker-compose up --build
| Endpoint |
Description |
GET /api/prices/{productId} |
Fetch prices from all vendors |
GET /mock-api/amazon/{productId} |
Mock Amazon API |
GET /mock-api/flipkart/{productId} |
Mock Flipkart API |
GET /mock-api/walmart/{productId} |
Mock Walmart API |
| Component |
Technology |
| Framework |
Spring Boot 4.0.5 |
| Web |
Spring MVC + WebFlux (WebClient) |
| Cache |
Caffeine (local) + Redis (distributed) |
| Language |
Java 25 |
| Build |
Gradle + Jib |
| Profile |
Description |
default |
Local development (no Redis) |
prod |
Production with Redis |
See Part2.md and Part3.md for details.
src/main/java/in/codefarm/price/aggregator/
├── PriceAggregatorApplication.java
├── config/
│ ├── PriceConfig.java
│ ├── RedisConfig.java
│ └── WebClientConfig.java
├── controller/
│ ├── PriceController.java
│ └── MockVendorController.java
├── dto/
│ └── PriceResponse.java
├── external/
│ ├── AmazonClient.java
│ ├── FlipkartClient.java
│ ├── WalmartClient.java
│ └── PriceAggregator.java
└── service/
├── PriceService.java
└── PriceCacheService.java
Dockerfile - Application container
docker-compose.yml - Redis + App orchestration