A Notification & Reminder microservice responsible for processing asynchronous events and sending automated email notifications. The service consumes messages from RabbitMQ, stores notification requests, and uses scheduled cron jobs to send emails reliably.
- Email Notification Service
- RabbitMQ Message Consumer
- Event-Driven Architecture
- Scheduled Email Processing
- Automated Reminder System
- MySQL Database Integration
- Sequelize ORM
- Nodemailer Email Service
- Cron Job Scheduling
- Notification Status Tracking
- Node.js
- Express.js
- MySQL
- Sequelize ORM
- RabbitMQ
- amqplib
- Nodemailer
- Node Cron
- dotenv
Booking Service
|
| (RabbitMQ Event)
v
Reminder Service
|
|---- Store Notification
|
|---- Cron Job Scheduler
|
|---- Send Email
|
v
MySQL
The service listens to events generated by other microservices, stores notification requests, and periodically processes pending notifications.
- Another microservice publishes an event.
- RabbitMQ forwards the event to Reminder Service.
- Notification request is stored in the database.
- Cron Job periodically fetches pending notifications.
- Email is sent using Nodemailer.
- Notification status is updated.
- RabbitMQ Consumer
- Queue Binding
- Event Processing
- Message Parsing
- Create Notification Ticket
- Track Notification Status
- Update Delivery Status
- Store Pending Notifications
- Automated Email Sending
- Gmail SMTP Integration
- Scheduled Processing
- Delivery Tracking
- id
- subject
- content
- recepientEmail
- status
- notificationTime
- createdAt
- updatedAt
Clone the repository:
git clone <repository-url>Install dependencies:
npm installConfigure environment variables:
PORT=3003
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=password
DB_NAME=notification_db
EMAIL_ID=your_email@gmail.com
EMAIL_PASS=your_app_password
MESSAGE_BROKER_URL=amqp://localhost
EXCHANGE_NAME=BOOKING_EXCHANGERun migrations:
npx sequelize-cli db:migrateStart the server:
npm startsrc/
│
├── config/
├── controller/
├── services/
├── repository/
├── models/
├── migrations/
├── util/
│ ├── job.js
│ └── messageQueue.js
└── index.js
- Microservices Architecture
- Event-Driven Architecture
- RabbitMQ Messaging
- Asynchronous Processing
- Background Jobs
- Email Automation
- Cron Scheduling
- Notification Systems
- Repository Pattern
- Service Layer Pattern
- SMS Notifications
- Push Notifications
- Retry Mechanism
- Dead Letter Queues
- Notification Templates
- Email Queue Prioritization
- Redis Integration
- Docker Deployment
Developed as a notification microservice for handling asynchronous communication and automated email reminders within a scalable flight booking ecosystem.