Notification Processing Pipeline
Summary
NotificationDispatcher.DispatchAsync processes one event end to end: idempotency check, staleness check, intent resolution, and — per resolved recipient and channel — preference evaluation, address resolution, template rendering, message creation and audited delivery. It ends by recording a processing outcome and audit row.
Pipeline stages
Idempotency and staleness
Before any work, the dispatcher checks ProcessedEvents for the EventId; a duplicate is audited and skipped. When StaleAfterHours is greater than zero and the event’s OccurredAtUtc is older than the window, it is audited as stale, marked processed and ignored.
Recipient and channel fan-out
The resolver returns zero or more intents. For each intent the dispatcher upserts the recipient into the directory, then iterates the intent’s normalized, de-duplicated channels. Each channel is independently evaluated for preference and address before rendering.
Outcome determination
After the loop, the outcome is derived: Processed when any message was created; otherwise Suppressed, NoTemplate or NoRecipient based on what was observed. The outcome is written to ProcessedEvents (with the message count) and to the audit trail.
Audit trail
Every stage — Received, RecipientResolved, Suppressed, TemplateMissing, MessageCreated, Delivered, Retried, DeliveryFailed, Processed — is written to NotificationAuditLog with tenant, event, message, correlation and trace identifiers. The trail is append-only.
Verified absence
There is no multi-pass or scheduled reprocessing, no batch pipeline and no separate NotificationProcessor. Processing is synchronous within one consumed-event scope.
Requires Confirmation
Retention and archival of ProcessedEvents and NotificationAuditLog, and the intended staleness window in production, require confirmation.
Source References
microservices/src/notification-service/Application/NotificationDispatcher.csmicroservices/src/notification-service/Application/EventNotificationResolver.csmicroservices/src/notification-service/Domain/NotificationEntities.cs
Related Articles
See Also
Keywords
Processing pipeline, dispatch, idempotency, staleness, outcome, audit.
Revision Information
- Status: Draft
- Last reviewed: 2026-07-21
- Next review: 2026-10-21