Retry failed webhook deliveries with exponential backoff #702
Openccarvalho wants to merge 3 commits into main from feat/webhook-retries· opened 3 days ago
+63−21
ccarvalho commented 3 days agoAuthor
Problem
A single 502 from a customer's endpoint currently sends the event straight to the dead letter queue.
Support gets a few of these tickets a week ("we missed an invoice.paid event").
Change
deliver now retries up to 5 times with exponential backoff (500 ms base)
The attempt number is included in the body so receivers can tell retries apart
dispatch throws if any endpoint ultimately fails; the worker nacks the job and the queue
redelivers it after 60 s instead of dead-lettering it immediately
New DeliveryResult enum instead of booleans
Testing
Pointed it at a requestbin that returns 500 and saw 5 attempts in the logs.
Problem
A single 502 from a customer's endpoint currently sends the event straight to the dead letter queue. Support gets a few of these tickets a week ("we missed an invoice.paid event").
Change
delivernow retries up to 5 times with exponential backoff (500 ms base)dispatchthrows if any endpoint ultimately fails; the workernacks the job and the queue redelivers it after 60 s instead of dead-lettering it immediatelyDeliveryResultenum instead of booleansTesting
Pointed it at a requestbin that returns 500 and saw 5 attempts in the logs.