Webhook Anti-patterns

1 min read Original article ↗

A better production webhook system allows for a consumer's configuration to be updated such that requests can be paused. Like stoppable webhooks, this should be configurable on-demand, without requiring a re-deployment of the producer application.

Unlike stoppable webhooks, the events enqueued during the pause should not be discarded. These events should be stored—either in the queue or in a database—for a future time when the consumer resumes webhooks.

When the consumer's webhooks are resumed, the system should send the events that were enqueued during the pause. Special care should be taken to ensure that the paused events are not sent simultaneously, as it could be a substantial volume of traffic that could harm the consumer. Use a queue, use retries, use backoff, and get those events sent out!