How eclipse-ecsp/notification-center works
Project Type and Purpose
• Notification Center is a Java-based, event-driven microservice (Maven multi-module) that provides a unified API for sending notifications (push, email, SMS, in-vehicle messaging) and managing notification templates, configurations, preferences, and history.
• It comprises two deployable services:
• notification-api (“api” module) – REST API for provisioning templates, sending notifications, querying history, user/vehicle preferences, etc.
• notification-sp (“sp” module) – stream processor that consumes notification events from a message bus, applies business logic (deduplication, scheduling, content transformation), and dispatches to external channels.
Key Modules & File‐Structure Indicators
• Top-level modules:
• api – Spring Boot REST service (controllers, DTOs, services, Mongo migrations via Mongock).
• sp – Stream‐processing service (Ignite or Kafka listener, scheduling processors, channel notifiers).
• utility – CLI or background job for bulk template/config updates.
• common-model & notification-common – shared POJOs, DAOs, repositories, utilities for MongoDB, DynamoDB, Redis, and AWS integrations.
• Infra config: Dockerfiles, application.properties, Kafka keystores, CI/CD workflows.
a. Main Components
• Clients: Mobile App / Web UI / Vehicle Telematics
• notification-api
‣ HTTP REST Controllers
‣ Service Layer (template management, sendNotification)
‣ MongoDB (templates, config, history)
‣ Kafka Producer (or AWS Kinesis)
• notification-sp
‣ Kafka Consumer / Stream Listener
‣ Processing Chain (deduplicator, scheduler, content transformers)
‣ Cache Layer (Ignite, Redis)
‣ Channel Adapters (AWS Pinpoint, SNS, SES, MQTT broker, IVM)
‣ History Service (write back status to MongoDB)
• utility
‣ Spring CLI tool for bulk updates, reads JSON/CSV → updates MongoDB
• Shared Libraries
‣ common-model, notification-common for domain objects, DAOs, encryption, validation
• Infrastructure
‣ MongoDB cluster
‣ Kafka cluster (topics: notification-requests, retries, DLQ)
‣ Ignite / Redis for caching templates or deduplication keys
‣ External Services: AWS Pinpoint, SNS, SES, Vehicle Profile Service, User Profile Service
b. Data Flows & Interactions
1. Client → HTTP → notification-api
2. notification-api validates request → persists to MongoDB → publishes event to Kafka topic
3. notification-sp subscribes to Kafka → pulls event → goes through processing chain
4. processing chain may enrich event by calling User/Vehicle Profile Service, apply deduplication using Redis or Ignite, schedule (immediate or delayed)
5. after transformation, channel adapter sends to external service (e.g., AWS Pinpoint for push, SES/SNS for email/SMS, MQTT broker for browser, proprietary IVM)
6. success/failure callback or status update → notification-sp writes back history/status to MongoDB
7. Client can query history via notification-api (reads from MongoDB)
Architectural Patterns & Principles
• Microservices: Two deployables (api, sp) each with its own lifecycles, Docker images, K8s pods
• Event-driven: decoupling via Kafka (or Kinesis) topics
• Layered (hexagonal) architecture: Controllers → Services → DAOs → External Adapters
• Shared domain libs (common-model, notification-common) to enforce contracts across modules
• Cache aside: Ignite/Redis caches for high-throughput deduplication/content lookup
• CI/CD & Infrastructure as Code: Dockerfiles, Helm charts, GitHub Actions workflows
Essential Details to Capture
• Modules & their boundaries (api vs sp vs utility)
• Message broker as the integration point
• Database reads/writes for templates, config, history
• Cache lookups for dedup / content templates
• External channel adapters & the specific channel services
• Shared library dependencies – highlight common-model & notification-common as JAR dependencies