← All projects

System integration · Backend services

Webhook delivery queue

A webhook service that stores events before sending them, retries failed deliveries, and keeps an attempt history. The operator console supports pausing endpoints and replaying failed jobs.

Local service and operations rehearsal completed

Recorded HTTP requests and deduplicated receiver effects across three local test scenarios.
Recorded HTTP requests and deduplicated receiver effects across three local test scenarios.

Implementation

Event acceptance and destination jobs commit together. Workers claim a lease, send outside the transaction, and finish only if their lease token is still valid. A restarted service can recover expired claims.

The sender signs each request with HMAC-SHA256, retries transport and selected HTTP failures, and retains terminal attempts for inspection. Operators can pause destinations and replay dead letters.

A local receiver fixture verifies signatures and deduplicates event IDs. One endpoint accepts an event, then closes the connection before sending its first response. The replay exercises the sender's uncertain-delivery case.

Checked online SQLite snapshots, restore into a new directory, and a periodic backup command are included. An executed operations rehearsal covers abrupt process exits, recovery and rejected inputs.

Inputs and assumptions

  • Included pump-inspection events are synthetic. The three-worker demonstration uses four local endpoints and a one-request limit per endpoint.
  • Python 3.12 and SQLite on one host. The earlier TypeScript/PostgreSQL distributed plan is not included.
  • Delivery is at least once. Receivers must deduplicate business effects by event ID; the queue cannot infer whether a lost response followed a commit.

Results

WEBHOOK DELIVERY / RECORDED TRACE

Retry after a lost response

Recorded attempts for event inspection-001.

01Senderinspection-001
02ReceiverDeduplicate by ID
03ReceiptDelivery status
  1. Send event
  2. Response lost
  3. Retry same ID
  4. Delivery confirmed
0.00 ms

The first attempt starts.

1 / 4
2 requests1 receiver effect

One event from the local test fixture. Step through its recorded delivery attempts.

Source files ↓
Recorded results for the included reference case
Integration tests passed28
Demonstration jobs37
Delivered / permanent rejection36 / 1
Total HTTP attempts49
Response-loss requests / receiver effects24 / 12
Operational checks passed15 / 15
Report figures (2)
Local delivery console after a lost response was retried and a separate endpoint returned HTTP 422.
Local delivery console after a lost response was retried and a separate endpoint returned HTTP 422.
Recorded HTTP requests and committed receiver effects for the normal, response-loss and slow endpoints.
Recorded HTTP requests and committed receiver effects for the normal, response-loss and slow endpoints.

Open the full report ↗

Verification

28 tests pass for claims, lease recovery, stale completions, retries, signatures, retention, destination restrictions and authorization. The executed response-loss scenario records one receiver effect for each retried event. A separate operations rehearsal passes 15 expected-outcome checks, including process crashes, checked snapshots, restore and a finite backup schedule.

python verify.py
python demo.py
python operations_rehearsal.py
Download the verification record ↓

Additional scenarios

15 outcomes checked through executed synthetic operations. The report lists the expected and observed outcomes for each check.

Read the validation report ↗

Project files

The ZIP contains the source, inputs, results, and instructions. These files are also available individually.

Download project ZIP · 142 KB
Archive checksum

SHA-256

13e8c9460326aaa8ff6c9ee9812e973ee1aeb65f64ec594872ed0eba7388d301
Original project scopeArchived brief PDF ↗

Run locally

Python 3.12+ / SQLite via Python standard library

Extract the ZIP and open a terminal in the webhook-delivery-queue folder. The README includes setup and usage details.

# Terminal 1:
python receiver.py
# Terminal 2:
python app.py --demo
# Open http://127.0.0.1:9080
python verify.py
python demo.py
python build_report.py
python operations_rehearsal.py

Limits

  • Single-host SQLite service with local administrative bearer access. No enterprise identity, high availability, Postgres adapter or production TLS API listener.
  • Retries use capped exponential backoff without jitter or Retry-After support. DNS timing follows the OS resolver. A crash before sending consumes an attempt.
  • Seven-day terminal payload retention is implemented; job, attempt and audit metadata do not have automatic retention. Purged payloads cannot be replayed.
  • The additional operations run sends 80 synthetic jobs through four workers and records 120 HTTP attempts with 80 receiver effects. It is a finite local workload, not an internet capacity or physical power-loss qualification.