A production-grade, event-driven notification system built using Spring Boot and Apache Kafka. This project demonstrates scalable backend architecture with asynchronous processing, fault tolerance, and clean design patterns.
This system allows users to send notifications (Email, SMS) via a REST API. Instead of processing requests synchronously, messages are pushed to Kafka and handled asynchronously by consumers.
Client → REST API → Kafka (Producer) → Consumer → Strategy → Notification Sent
↓
DLQ (on failure)
- Backend: Spring Boot (Java 21)
- Messaging: Apache Kafka
- Containerization: Docker
- Build Tool: Maven
- Design Patterns: Strategy Pattern
- Architecture Style: Event-Driven Microservice
- Decouples request handling using Kafka
- Improves scalability and responsiveness
- Clean separation for notification channels
- Easily extendable (Email, SMS, Push, etc.)
- Failed messages are retried automatically
- After retries, messages are routed to a DLQ topic
- Prevents users from spamming the system
- Fixed window rate limiting per user
- Ensures no message loss
- Handles failures gracefully
com.example.notificationengine
├── controller/
├── model/
├── service/
├── strategy/
├── config/
git clone https://github.com/GeekyHim/Distributed-Notification-Service-Project.git
cd notification-enginedocker-compose up -dmvn spring-boot:runPOST /api/v1/notifications/send
{
"userId": "123",
"message": "Hello from Kafka",
"channel": "EMAIL",
"recipient": "test@example.com"
}Note: To simulate a failed respnse, use the word "fail" in message field.
- Message processed and sent via selected strategy
- Message retried 3 times
- Then moved to
notification-dlqtopic
- Event-driven architecture
- Producer-consumer pattern
- Backpressure handling
- Fault tolerance with DLQ
- Rate limiting
- Clean code principles
- Redis-based distributed rate limiting
- Notification history with database
- API Gateway integration
- Monitoring & logging
Himanshu Gupta
Computer Science Engineering | Chandigarh University