The Distributed Notification App is a Spring Boot application integrated with RabbitMQ and MySQL. It provides a notification management system, enabling prioritized and persistent notification processing while supporting multiple delivery channels.
- RabbitMQ Integration:
- Queue-based message processing.
- Support for multiple listeners.
- MySQL Persistence:
- Save notifications for tracking and auditing.
- Priority-Based Notifications:
- Handle high, medium, and low-priority notifications.
- Multiple Delivery Channels:
- Mobile devices.
- Database logging.
- Containerized with Docker:
- Fully functional via Docker Compose.
- RabbitMQ:
- Acts as the message broker for notification distribution.
- Supports different exchange types for message routing.
- Spring Boot:
- Processes notifications with multiple consumers.
- Saves notifications to MySQL database.
- MySQL:
- Stores notification data persistently for auditing and reporting.
- Docker and Docker Compose installed.
- Java 17 or higher installed locally.
- Maven installed for local development.
git clone https://github.com/mustafaoezkan/distributed-notification-app.git
cd distributed-notification-app
Create a .env
file in the project root:
# MySQL Configuration
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=notifier
MYSQL_USER=root
MYSQL_PASSWORD=root
# Spring App Configuration
SPRING_DATASOURCE_USERNAME=root
SPRING_DATASOURCE_PASSWORD=root
Build and run the application with Docker Compose:
docker compose up --build
Access RabbitMQ management UI at:
- URL: http://localhost:15672
- Username:
guest
- Password:
guest
Access MySQL using your preferred client:
- Host:
localhost
- Port:
3307
- Database:
notifier
- Username:
root
- Password:
root
Use Postman or curl
to send a test notification:
curl -X POST \
-H "Content-Type: application/json" \
-d '{"title": "Test Title", "message":"Test Notification","recipient":"user@example.com","priority":"HIGH"}' \
http://localhost:8080/api/notifications
distributed-notification-app/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ ├── com.example.distributednotificationapp/
│ │ │ │ ├── config/ # RabbitMQ configuration
│ │ │ │ ├── controller/ # REST controllers
│ │ │ │ ├── entity/ # JPA entities
│ │ │ │ ├── repository/ # JPA repositories
│ │ │ │ ├── service/ # Service classes
│ │ │ │ └── model/ # Models for message payloads
│ ├── resources/
│ │ ├── application.properties # Spring configuration
├── Dockerfile
├── docker-compose.yml
├── README.md
└── .env
Create a new notification.
{
"title": "Test tilte",
"message": "Your notification message",
"recipient": "user@example.com",
"priority": "HIGH"
}
Retrieve all notifications stored in the database.
- Retry Mechanism:
- Add a dead-letter queue for failed notifications.
- Push Notification Support:
- Extend to support real-time WebSocket notifications.
- Admin Dashboard:
- Create a front-end for monitoring notifications.
This project is licensed under the MIT License. See the LICENSE file for details.