Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Support at least once delivery of webhook events #591

Open
andresuribe87 opened this issue Jul 13, 2023 · 0 comments
Open

Support at least once delivery of webhook events #591

andresuribe87 opened this issue Jul 13, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@andresuribe87
Copy link
Contributor

Currently, webhooks are best effort. If delivery fails (because of a crash or because the receiving end is down), then we simply log a message and never try again. This limits the ways in which webhooks can be used.

To support a wider range of use cases, supporting at least once delivery would be useful.

Here's one way in which it can work:

  • At the API level, add a deliveryOptions enum. By default, it's best effort, and can be set to at least once.
  • When a webhook is configured with at least once, persist the payload that should be sent in a storage. Let this be webhook_messages_outgoing_stream. Each message should have a UUID.
    • Note that the storage interface might need to be extended to support queue (or streaming) operations.
  • Have a pool of worker goroutines, which are started during main and periodically listen to webhook_messages_outgoing_stream.
  • After a worker successfully delivers (success can be a response HTTP status code of 2xx), mark the webhook_message as sent. For debug purposes, the payload of the response received can be recorded. Take care to make things idempotent.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
No open projects
Status: 🆕 New
Development

No branches or pull requests

3 participants