Skip to content

Backend: Implement Webhook Event Replay and Dead-Letter Queue Management #453

Description

@Smartdevs17

Context

Webhook delivery reliability is critical for merchants integrating with AgenticPay. Failed deliveries can result in missed payment notifications, order fulfillment delays, and merchant dissatisfaction.

Current Limitation/Problem

Webhook delivery has basic retry with exponential backoff, but no replay capability, no dead-letter queue for permanent failures, and no dashboard for monitoring delivery health.

Expected Outcome

A robust webhook delivery system with configurable retry policies, a dead-letter queue for persistently failing deliveries, manual replay capability, and a delivery health dashboard.

Acceptance Criteria

  • Configurable retry policy per endpoint (max retries, backoff multiplier, timeout)
  • Dead-letter queue with permanent failure categorization (invalid endpoint, bad signature, rate limited)
  • Manual replay single or batch from DLQ via API
  • Webhook delivery logs with response status, latency, and payload preview
  • Dashboard showing delivery success rate, average latency, and failure breakdown
  • Alert when delivery success rate drops below 99%
  • Export delivery logs as CSV
  • Support retry window expiration (discard after 7 days)

Technical Scope

  • backend/src/services/webhooks/delivery-manager.ts - enhanced delivery logic
  • backend/src/services/webhooks/dead-letter-queue.ts - DLQ management
  • Prisma: WebhookDeliveryLog, WebhookDeadLetter, WebhookEndpoint enhancements
  • BullMQ queues: webhook-delivery, webhook-dlq, webhook-replay
  • Frontend: /dashboard/developers/webhooks - delivery health page
  • Edge cases: endpoint permanently down, invalid SSL, payload too large

Metadata

Metadata

Assignees

Labels

200-points200 point issueStellar WaveIssues in the Stellar wave programdrips-waveIssues in the Drips Wave programhighHigh complexity issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions