Local service and operations rehearsal completed

Webhook delivery queue

A durable webhook service with signed requests, worker leases, bounded retries, endpoint controls and a delivery history.

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

Recorded results

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.
Machine-readable result summary
{
  "fixture": "synthetic pump inspection events; fresh local HTTP receiver",
  "events": 13,
  "jobs": 37,
  "workers": 3,
  "per_endpoint_inflight": 1,
  "counts": {
    "dead": 1,
    "delivered": 36
  },
  "attempts": 49,
  "elapsed_seconds": 1.695,
  "outcomes": {
    "delivered": 36,
    "dead": 1,
    "retry": 12
  },
  "receivers": {
    "normal": {
      "requests": 12,
      "business_effects": 12
    },
    "response-loss": {
      "requests": 24,
      "business_effects": 12
    },
    "slow": {
      "requests": 12,
      "business_effects": 12
    }
  },
  "assertions": {
    "all_jobs_terminal": true,
    "response_loss_retried": true,
    "receiver_effects_deduplicated": true,
    "permanent_rejection_dead_lettered": true
  },
  "measurement_note": "Elapsed time includes fixture shutdown; this small local scenario is not a throughput benchmark."
}

Verification

28 of 28 tests passed. Failures: 0. Errors: 0.

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

Verification record

Executed test cases
  • test_queue.HttpTests.test_lost_response_retries_same_id_with_one_business_effect
  • test_queue.HttpTests.test_operator_api_auth_and_event_acceptance
  • test_queue.HttpTests.test_redirect_is_not_followed
  • test_queue.HttpTests.test_timeout_completes_attempt_as_retry
  • test_queue.HttpTests.test_valid_signature_and_invalid_signature
  • test_queue.PolicyTests.test_credentials_fragment_and_http_are_rejected
  • test_queue.PolicyTests.test_defaults_deny_all_destinations
  • test_queue.PolicyTests.test_dns_mixed_public_private_is_rejected
  • test_queue.PolicyTests.test_global_address_is_returned_for_pinned_connection
  • test_queue.PolicyTests.test_ipv6_mapped_and_linklocal_are_rejected
  • test_queue.PolicyTests.test_test_exception_is_exact_origin
  • test_queue.QueueTests.test_accept_is_atomic_across_destinations
  • test_queue.QueueTests.test_bad_payloads_are_rejected
  • test_queue.QueueTests.test_bounded_backoff_and_dead_letter
  • test_queue.QueueTests.test_concurrent_claims_have_one_owner
  • test_queue.QueueTests.test_crash_budget_is_bounded
  • test_queue.QueueTests.test_expired_owner_cannot_finish_without_replacement
  • test_queue.QueueTests.test_identical_retry_and_conflicting_id
  • test_queue.QueueTests.test_paused_endpoint_and_resume
  • test_queue.QueueTests.test_permanent_rejection_does_not_retry
  • test_queue.QueueTests.test_redirect_is_terminal
  • test_queue.QueueTests.test_replay_keeps_event_id_and_attempt_history
  • test_queue.QueueTests.test_restart_preserves_committed_event
  • test_queue.QueueTests.test_retention_preserves_pending_and_rejects_expired_replay
  • test_queue.QueueTests.test_signing_secret_is_absent_from_snapshot_and_audit
  • test_queue.QueueTests.test_slow_endpoint_capacity_does_not_block_other_endpoint
  • test_queue.QueueTests.test_worker_crash_expires_and_fences_stale_completion
  • test_queue.StartupTests.test_demo_setup_and_repeat_start

Run locally

Python 3.12+ / SQLite via Python standard library

# 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

Full setup and usage instructions

Source and evidence

Limits