Monday, 21 September 2020

How to Handle Missed Webhooks I'm Subscribed To?

Let's say I have a project built in node.This project is subscribed to a 3rd party service's webhooks endpoint to receive notifications/info from 3rd party. (e.g. Shopify [ex: new order created], Github [ex: new commit made], etc)For the sake of the post, let's say the Webhooks service of the 3rd party does not include a "retry" feature in case a webhook is missed on the recipient side for reasons such as:if my node project were to crash due to unforeseen errors/issuesif my node project is down for maintenanceWhat are some ways to handle missed webhooks, preferably scalable?Because if I do scheduled API calls at set interval (i believe the term is called 'polling'), that basically defeats the purpose of the webhooks' benefits in the first place and I would have to implement a way to keep track of what has/has not been processed to avoid duplicates. 🤔Another idea I had was to create a script to load the webhooks notifications into a redis cache (message queue) and have the main node project handle each of the cached entries (like a to do list, but for the program lol).I am somewhat skeptical about these 2 ways, and was hoping if you guys have any other ideas that are better than what I have thought up of. Open to suggestions, thanks! :)

Submitted September 22, 2020 at 01:56AM by ewliang

No comments:

Post a Comment