A production-inspired bulk notification platform built with Spring Boot, RabbitMQ, Redis, PostgreSQL, and Redis for reliable asynchronous Email, SMS, and Push delivery.
Java 21 • Spring Boot • RabbitMQ • Redis • PostgreSQL • Docker • Prometheus • Grafana
- Features
- Architecture
- Delivery Flow
- Reliability
- Observability
- Tech Stack
- Getting Started
- API Overview
- Project Structure
- Roadmap
- Email delivery (SMTP)
- SMS delivery (Twilio)
- Push notifications (simulated)
- Recipient management
- Template management
- Scheduled campaigns
- Audience segmentation
- Campaign dispatch worker
- RabbitMQ-based asynchronous processing
- JWT Authentication
- API Key Authentication
- Role-Based Access Control
- Redis-backed idempotency
- RabbitMQ durable queues
- TTL retry queues
- Dead Letter Queue (DLQ)
- Micrometer metrics
- Prometheus
- Grafana dashboards
- Spring Boot Actuator
graph TD
Client[Client / API Consumer] -->|REST API| API[Notifyr API<br/>Spring Boot]
API -->|Auth| Security[API Key / JWT<br/>Filters]
API -->|Read / Write| DB[(PostgreSQL)]
API -->|Idempotency Keys| Cache[(Redis)]
API -->|Publish Trigger| Exchange[RabbitMQ Exchange]
Exchange --> DispatchQ[Campaign Dispatch Queue]
DispatchQ --> DispatchWorker[Campaign Dispatch Worker]
DispatchWorker -->|Fan-out per recipient| NotifQ[Notification Queue]
NotifQ --> Worker[Notification Worker<br/>routes by channel]
Worker -->|SMTP| Mailtrap[Mail Provider]
Worker -->|API| Twilio[Twilio]
Worker -->|Simulated| PushSim[Push - Simulated]
Worker -.->|On Failure| RetryQ[TTL Retry Queues<br/>30s / 2m / 5m]
RetryQ -.->|Requeued after TTL| NotifQ
RetryQ -.->|Retries Exhausted| DLQ[Dead Letter Queue]
API --> Metrics[Micrometer]
Metrics --> Prometheus[(Prometheus)]
Prometheus --> Grafana[Grafana Dashboards]
Note: Email, SMS, and Push currently share a single Notification Queue and a single worker that routes to the correct provider based on the notification's channel. Dedicated per-channel queues (as originally scoped) are on the roadmap but not yet implemented.
- Campaigns are first persisted in PostgreSQL.
- A scheduler polls for due campaigns every 30 seconds.
- Campaigns are published to RabbitMQ instead of executing in-process.
- Notification workers consume messages asynchronously.
- Failed deliveries automatically retry before eventually reaching the Dead Letter Queue.
sequenceDiagram
participant Client
participant API
participant Scheduler
participant RabbitMQ
participant Worker
participant Provider
Client->>API: Create Campaign
Scheduler->>RabbitMQ: Publish Campaign
RabbitMQ->>Worker: Dispatch Notifications
Worker->>Provider: Send Email / SMS / Push
alt Success
Provider-->>Worker: Delivered
else Failure
Worker->>RabbitMQ: Retry Queue
RabbitMQ->>Worker: Retry
Worker->>RabbitMQ: Dead Letter Queue
end
Pipeline
Campaign
↓
Scheduler
↓
RabbitMQ
↓
Dispatch Worker
↓
Notification Queue
↓
Notification Worker
↓
SMTP / Twilio / Push
- Durable RabbitMQ queues
- Redis idempotency
- TTL retry queues (30s / 2m / 5m)
- Dead Letter Queue
- Failure-safe status tracking
- Delivery throughput
- Success / failure metrics
- Retry count
- Dead Letter Queue count
- Health checks
- Grafana dashboards
- Prometheus scraping
| Category | Technology |
|---|---|
| Language | Java 21 |
| Backend | Spring Boot |
| Database | PostgreSQL |
| Messaging | RabbitMQ |
| Cache | Redis |
| Authentication | JWT + API Key |
| Monitoring | Micrometer, Prometheus, Grafana |
| Documentation | Swagger / OpenAPI |
| Containerization | Docker & Docker Compose |
git clone <repo-url>
cd notifyr
cp .env.example .env
docker compose up -d --build| Service | URL |
|---|---|
| API | http://localhost:8080 |
| Swagger | http://localhost:8080/swagger-ui/index.html |
| RabbitMQ | http://localhost:15672 |
| Prometheus | http://localhost:9090 |
| Grafana | http://localhost:3000 |
POST /auth/register
POST /auth/login
POST /notifications/send
GET /notifications/{id}
POST /campaigns
GET /campaigns
PUT /campaigns/{id}
POST /campaigns/{id}/send
📖 Full request/response schemas are available through the Swagger UI.
notifyr/
├── controller/
├── service/
├── worker/
├── scheduler/
├── security/
├── provider/
├── repository/
├── entity/
├── dto/
└── config/
- Email Delivery
- SMS Delivery
- Push Simulation
- RabbitMQ Dispatch
- Retry Queues
- Dead Letter Queue
- Dedicated Email/SMS/Push queues
- Firebase Cloud Messaging
- Rate Limiting
- Webhooks