Integrations & scripts

webhook-proxy

Discord webhook proxy and queue

A go-between for our services and Discord webhooks: it puts notifications in a queue, waits when Discord tells it to slow down and retries failed sends so that no message is lost.

webhook-proxy

About the project

webhook-proxy is a middleware layer through which all outbound communication from our services to Discord webhooks passes. A webhook is an address a service sends a message to so that it appears in a channel. Discord caps how many sends it accepts and, under sudden traffic, answers with a 429 code (too many requests) or a momentary 5xx error (a server-side problem). webhook-proxy queues events separately for each target, waits out the limit and retries the send, so notifications do not get lost.

The challenge

Discord webhooks have hard rate limits, and during traffic spikes notifications can simply vanish: a 429 from the limit or a momentary 5xx and the event is gone. We needed a single point through which all outbound communication passes and that does not drop events.

What we did

  1. 01

    A separate event queue for each send target

  2. 02

    Handling 429 responses: waiting out the limit (backoff) before the next attempt

  3. 03

    Retrying sends after 5xx errors, without losing events

  4. 04

    A single exit point for all communication between our services and Discord

  5. 05

    Sudden traffic spikes go into the queue and notifications leave in order

Describe your project.

A free quote comes back within an hour during working hours.

Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.