Notification Service é uma API backend desenvolvida em Java 21 com Spring Boot para envio de notificações de forma assíncrona utilizando mensageria.
O sistema foi projetado com foco em arquitetura escalável, utilizando filas, workers e o Strategy Pattern para suportar múltiplos canais de notificação.
A API recebe requisições de envio e publica eventos em uma fila. Workers processam essas mensagens e executam o envio de acordo com o canal escolhido.
O projeto segue princípios inspirados em Clean Architecture e Hexagonal Architecture, separando claramente as responsabilidades da aplicação.
Controller
↓
Service
↓
UseCase
↓
Repository
↓
Message Producer
↓
Queue
↓
Consumer Worker
↓
Strategy Channel
- Java 21
- Spring Boot
- Spring Data JPA
- Spring AMQP
- Redis
- RabbitMQ
- PostgreSQL
- Docker
- Docker Compose
- Clean Architecture
- Strategy Pattern
- Event Driven Architecture
- Asynchronous Processing
src/main/java/com/notification
application
├── dto
├── service
└── usecase
domain
├── entity
├── enums
└── repository
infrastructure
├── channels
├── config
├── messaging
└── repository
interfaces
└── controller
Client
↓
REST API
↓
UseCase
↓
Save Notification
↓
Producer
↓
RabbitMQ Queue
↓
Consumer Worker
↓
Channel Strategy
↓
Send Notification
Atualmente o sistema suporta os seguintes canais:
- SMS
- Webhook
Cada canal possui uma implementação própria utilizando o Strategy Pattern, permitindo adicionar novos canais facilmente.
POST /notifications
{
"recipient": "user@email.com",
"message": "Hello world",
"channel": "EMAIL"
}{
"id": "uuid",
"recipient": "user@email.com",
"message": "Hello world",
"channel": "EMAIL",
"status": "PENDING",
"createdAt": "2026-03-09T12:00:00"
}mvn clean packagedocker compose up --build| Service | Port |
|---|---|
| API | 8080 |
| PostgreSQL | 5432 |
| RabbitMQ | 5672 |
| RabbitMQ Dashboard | 15672 |
| Redis | 6379 |
Acesse:
http://localhost:15672
Login:
guest
guest
Lázaro Vasconcelos