Add notification-service module: Kafka fan-out by user preference, per-channel templates, rate-limited workers, non-blocking retries with DLT, idempotent delivery (10 tests on embedded Kafka, 9 transcripts)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7rAEgiNi4Fo94nVoB
This commit is contained in:
Claude
2026-11-24 00:30:04 +05:30
parent ce12a80f58
commit 09f875ddd9
54 changed files with 1516 additions and 0 deletions
@@ -0,0 +1,31 @@
Fan-out: one request in, one message per allowed channel out
============================================================
1. user opted in to all three, template has all three (order-shipped)
EMAIL FANNED_OUT notification.requests publishing to notify.email
EMAIL SENT notify.email attempt 1
SMS FANNED_OUT notification.requests publishing to notify.sms
SMS SENT notify.sms attempt 1
PUSH FANNED_OUT notification.requests publishing to notify.push
PUSH SENT notify.push attempt 1
2. user has a phone number but has not opted in to SMS
EMAIL FANNED_OUT notification.requests publishing to notify.email
EMAIL SENT notify.email attempt 1
SMS SKIPPED notification.requests user has not opted in
PUSH FANNED_OUT notification.requests publishing to notify.push
PUSH SENT notify.push attempt 1
3. otp template only has an SMS body, so only SMS goes out
EMAIL SKIPPED notification.requests template otp has no EMAIL body
SMS FANNED_OUT notification.requests publishing to notify.sms
SMS SENT notify.sms attempt 1
PUSH SKIPPED notification.requests template otp has no PUSH body
4. unknown user
- SKIPPED notification.requests unknown user u-ghost
5. params missing: every channel skipped, nothing half-rendered is sent
EMAIL SKIPPED notification.requests no value for {{orderId}}
SMS SKIPPED notification.requests no value for {{orderId}}
PUSH SKIPPED notification.requests no value for {{orderId}}