Delivery Guarantees
What guarantees does HookSniff provide? At-least-once delivery with automatic retries.
At-Least-Once Delivery
HookSniff guarantees at-least-once delivery. This means:
- Every webhook will be delivered at least once
- If delivery fails, it will be retried automatically
- If all retries fail, the event is preserved in the DLQ
- You can replay failed deliveries at any time
Important:"At-least-once" means duplicates are possible. Your endpoint should be idempotent β able to handle the same event multiple times without side effects.
Why Not Exactly-Once?
Exactly-once delivery is theoretically impossible in distributed systems. The network can always fail between "I sent it" and "I got the response."
The practical solution is at-least-once delivery + idempotent consumers. HookSniff provides the delivery guarantee; you provide the idempotency.
How to Be Idempotent
Track processed delivery IDs and skip duplicates:
CREATE TABLE processed_webhooks ( delivery_id TEXT PRIMARY KEY, processed_at TIMESTAMPTZ DEFAULT NOW() ); -- Before processing: SELECT 1 FROM processed_webhooks WHERE delivery_id = $1; -- If exists, skip. If not, process and insert.
What Can Go Wrong?
| Scenario | HookSniff Behavior |
|---|---|
| Endpoint returns 2xx | Delivery marked as delivered |
| Endpoint returns 5xx | Retried with exponential backoff |
| Endpoint returns 429 | Retried with exponential backoff |
| Endpoint returns 4xx (other) | Not retried β client error |
| Connection timeout (30s) | Retried with exponential backoff |
| DNS failure | Retried with exponential backoff |
| All retries exhausted | Moved to DLQ, preserved for replay |
Data Durability
All delivery data is stored in PostgreSQL (Neon) with the following retention:
- Delivered events: Retained based on plan (7β365 days)
- Failed events (DLQ): Retained based on plan (7β365 days)
- Attempt details: Full response bodies, status codes, timestamps