Skip to content

Design an asynchronous dead-letter queue (DLQ) recovery API for stalled tRPC webhook mutations #460

Description

@Damola-Sodiq

Description

Build a robust Dead-Letter Queue (DLQ) system in the backend to catch, inspect, and replay failed smart contract webhook events.

Architecture & Context

When the Soroban RPC emits events to the backend, temporary database outages or malformed payloads can cause ingestion failures. A DLQ ensures these events are not lost but safely stored for programmatic or manual replay.

Technical Requirements

  • Create a dedicated Prisma schema table to store raw, unprocessed JSON payloads and their error stack traces.
  • Implement a cron-based Fastify worker to automatically retry transient errors with exponential backoff.
  • Build a secured tRPC mutation to manually edit and replay poisoned payloads.

Acceptance Criteria

  • Failed webhook events are strictly routed to the DLQ table.
  • Exponential backoff successfully recovers transient database timeout errors.
  • Poison messages do not block the active webhook ingestion pipeline.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions