Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Green-Pulse/Notification-Service

Open more actions menu

Repository files navigation

Notification Service

The Notification Service is responsible for delivering alerts and updates to users via various channels such as email, SMS or internal systems (Kafka).


Technologies

  • Java 21
  • Spring Boot 3.4.4
  • Kafka (consuming event messages)
  • Spring Mail (optional for email)
  • SLF4J + Logback (logging)
  • Prometheus + Grafana (observability)

Purpose

Service listens to Kafka topics like:

  • user-logged-in-event-topic
  • weather-data-event-topic

And performs actions such as:

  • Send email notifications
  • Log or store alerts
  • Update internal dashboards

Kafka Listener Example

@KafkaListener(topics = "user-logged-in-event-topic", groupId = "user-logined-events")
public void handleUserRegistration(UserRegisteredEvent event) {
    notificationService.sendWelcomeEmail(event.getEmail(), event.getUsername());
}

Sending Emails

config:

spring:
  mail:
    host: smtp.example.com
    port: 587
    username: email
    password: password
    properties:
      mail.smtp.auth: true
      mail.smtp.starttls.enable: true
@Service
public class EmailService {
    private final JavaMailSender mailSender;

    public void send(String to, String subject, String text) {
        SimpleMailMessage message = new SimpleMailMessage();
        message.setTo(to);
        message.setSubject(subject);
        message.setText(text);
        mailSender.send(message);
    }
}

Monitoring

Expose metrics at:

/actuator/prometheus

And track


Future Improvements

  • Add WebSocket notifications
  • Retry failed deliveries
  • Store alerts in database
  • Multi-language support
  • Notification templates (Thymeleaf / Markdown)

About

The Notification Service is responsible for delivering alerts and updates to users via various channels

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.