A Spring Boot microservice for handling notifications in the Clinicwave platform, supporting email notifications and message queuing.
- Email Notifications
- RabbitMQ Message Queue Integration
- Template-based Email Content
- Asynchronous Notification Processing
- Exception Handling
- Message Queue Listener
- Java 21
- Spring Boot 3.4.4
- Spring AMQP (RabbitMQ)
- Spring Mail
- Thymeleaf (Email Templates)
- Lombok
- Maven
- Listens to RabbitMQ queues for notification events
- Processes notifications asynchronously
- Handles different types of notifications
- Sends email notifications using Spring Mail
- Supports HTML email templates using Thymeleaf
- Configurable email properties
- RabbitMQ connection settings
- Email server configuration
- Template configuration
- Clone the repository
- Navigate to the project directory
- Configure the following properties in
application.properties:- RabbitMQ connection details
- SMTP server settings
- Email templates path
- Run the application using Maven:
mvn spring-boot:run
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guestspring.mail.host=smtp.example.com
spring.mail.port=587
spring.mail.username=your-email@example.com
spring.mail.password=your-password
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=trueThe service listens to the following queues:
notification.queue- Main queue for notification eventsdead-letter.queue- Queue for failed notification attempts
Email templates are stored in src/main/resources/templates/email/ and include:
- Verification email template
The service includes comprehensive error handling for:
- Message queue connection issues
- Email sending failures
- Template processing errors
- Invalid message formats