Skip to content

TASK: Consume durable payment state events in Notification Service #258

Closed

Description

@ramioooz

Type: Task
Epic: Payment Rail Architecture
Parent: .github#31 Payment Rail Architecture
Sprint: Sprint 5 - Payment Rails and Notifications
Service: notification-service
Priority: P0

Objective

Consume the governed PaymentInstructionStateChanged.v1 events and create durable notification work without coupling Payment Service to an external notification provider.

Scope

  • Consume payment.instruction.state.v1 from the existing SIT Kafka platform.
  • Validate the governed event envelope, producer, schema version, event identity, instruction identity, status, amount, currency, and occurred-at fields.
  • Deduplicate by eventId and quarantine invalid, conflicting, or exhausted records using the existing Notification Service inbox/error-handling conventions.
  • Create durable notification work for PENDING, COMPLETED, and FAILED payment instruction states.
  • Preserve at-least-once consumption and restart-safe behavior.
  • Add the required SIT topic/DLQ and Config Repository wiring only where the existing platform conventions require it.

Out of scope

  • Payment-provider adapters, provider credentials, external delivery integrations, and public payment routes.
  • Account or ledger balance mutation.
  • Transfer saga orchestration.
  • AWS/UAT/PROD deployment.
  • Redundant CI workflows or broad unit-test expansion; add only load-bearing persistence/consumer verification.

Acceptance criteria

  • A valid payment state event creates one durable notification work item and a matching inbox record.
  • Replaying the same eventId does not create duplicate notification work.
  • Invalid producer/schema/envelope data is rejected and reaches the governed failure/DLQ path.
  • PENDING, COMPLETED, and FAILED states are represented distinctly in durable notification work.
  • Maven verification, Helm validation, and the existing container smoke check pass.
  • SIT verification demonstrates one payment event consumed, one duplicate safely ignored, and one invalid event quarantined without blocking subsequent valid events.
  • All implementation work remains linked to .github#31 in Project STORY: Establish Java service quality gates and SonarQube strategy #1.

Activity

  1. self-assigned this
    on Sep 7, 2026
  2. ramioooz commented on Sep 7, 2026

    @ramioooz
    MemberAuthor

    Implementation is ready for review in notification-service #14.

    • Normal, non-draft PR; no merge performed.
    • CI is green: Maven verification, Helm validation, and container build/smoke check passed.
    • The implementation consumes payment.instruction.state.v1, validates the governed envelope, persists durable inbox/work/quarantine records, deduplicates by eventId, and handles invalid/conflicting/exhausted records without adding provider integrations or public routes.
    • The PR remains linked to this task and parent .github#31.

    After review/merge, roll out Notification Service in SIT and verify one valid payment event, one duplicate replay, and one invalid-event quarantine/DLQ path before closing the task.

  3. ramioooz commented on Sep 7, 2026

    @ramioooz
    MemberAuthor

    SIT candidate verification completed for the review implementation:

    • Image: digital-bank-java/notification-service:sit-payment-events-fix2-20260907
    • Helm release: notification-service, revision 10
    • Deployment: 1/1 Ready, zero restarts
    • Health: /actuator/health returned UP
    • Kafka: consumer group notification-service is assigned to payment.instruction.state.v1-0 and the existing events.transfer.created.v1-0
    • Startup: application completed successfully; no startup error or exception was observed after the mapper and consumer-factory fixes

    This is deployment and consumer-assignment evidence only. Functional valid-event, duplicate-event, and invalid-event quarantine/DLQ acceptance remains pending after notification-service #14 is merged.

  4. ramioooz commented on Sep 7, 2026

    @ramioooz
    MemberAuthor

    Functional SIT acceptance completed with synthetic Kafka records on 2026-09-07:

    • Valid PaymentInstructionStateChanged.v1 (PENDING) was published to payment.instruction.state.v1.
    • PostgreSQL verification: exactly one payment_event_inbox row and one payment_notification_work row were created for the event.
    • The exact same event was published again. PostgreSQL still contains one inbox row and one work row for the instruction, confirming event-id deduplication.
    • A malformed event with lowercase currency was published. PostgreSQL contains one payment_event_quarantine row and no inbox row for that event.
    • Kafka consumer group notification-service committed through the test records with lag 0.

    Evidence uses synthetic identifiers and contains no credentials or business data. Task #258 remains in review until notification-service #14 is merged.

  5. ramioooz commented on Sep 7, 2026

    @ramioooz
    MemberAuthor

    Post-merge SIT acceptance complete

    • Merged implementation: notification-service #14, merge commit 2ceb64b.
    • Built image: digital-bank-java/notification-service:sit-payment-events-main-20260907.
    • Helm release revision: 11 in digital-bank-sit.
    • Deployment: 1/1 Ready, zero restarts; actuator health UP.
    • Kafka group notification-service assigned both payment.instruction.state.v1-0 and events.transfer.created.v1-0; payment topic lag is 0.
    • Acceptance records remain correct after the merged-mainline rollout: one valid inbox row, one notification-work row, one quarantine row for the malformed event, and one work row after exact duplicate delivery.

    The task is complete. AWS/UAT/PROD delivery, external notification providers, and public notification routes remain outside this Sprint 5 task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions