Skip to content

Repository files navigation

webhook-delivery-system

A webhook delivery system using BullMQ and Redis to process HTTP delivery jobs asynchronously with automatic retries on failure.

What it does

  • Accepts webhook delivery requests and responds instantly with a job ID
  • Processes actual HTTP delivery in the background via a BullMQ worker
  • Automatically retries failed deliveries 3 times with exponential backoff
  • All traffic routed through NGINX — NestJS is not exposed directly

Prerequisites

  • Node.js
  • Docker

How to run

npm install
docker compose up --build

Endpoints

Deliver a webhook

POST /webhooks/deliver
{
  "url": "https://your-endpoint.com/webhook",
  "payload": {
    "event": "message.sent",
    "data": {}
  }
}

Returns immediately:

{ "success": true, "jobId": "1" }

Delivery happens in the background. If it fails, BullMQ retries 3 times with exponential backoff — 1s, 2s, 4s.

Architecture

HTTP Client
     ↓
NGINX (port 80) — sole entry point
     ↓
NestJS (ValidationPipe)
     ↓
WebhooksService → BullMQ Queue (Redis)
                        ↓
                  QueueProcessor (Worker)
                        ↓
                  HTTP POST to target URL
                  (retries on failure)

Stack

  • NestJS
  • BullMQ
  • ioredis
  • Docker + Docker Compose
  • NGINX

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages