2

We are trying to write a webhook where we notify the subscribers details about all their resources if one or more resource becomes 'inactive'.

Since, different subscribers can have different number of resources, the payload size of webhook POST request to a URL will vary.

Sample payload -

{ "id1": "inactive", "id2": "inactive", "id5": "inactive" ... }

There is no limit to the amount of resources a subscriber can own, so it can be as high as 50,000 or more.

As the payload can be higher in certain cases, problem which arises are-

  1. Producer of the webhook can take time if payload size is high
  2. Consumer (endpoint) receiving the webhook may not be able to accept such high payload

Some input on the following will be helpful:

  1. How to handle such situation? What is the right limit of payload which can be allowed via webhook like say 5MB? Github defines a maximum cap of 25MB for webhooks. How to come up with such a number?
  2. What happens if payload limit is breached?
  3. Skinny Payload can be used here? Like a global status indicating everything is alright or not, using which users can do a PULL (GET request) to get the entire set of data. But here, users will need to receive the webhook and then again do one more request if things are not alright. [Ref: http://resthooks.org/docs/performance/]

PS: Please pardon me if this isn't the right way I'm asking this question. Using stack overflow after long.

Sarthak Singhal
  • 665
  • 2
  • 10
  • 26
  • Why not have a "resource_inactive" webhook and only include the resources that have become inactive? I wouldn't recommend using webhooks as a replacement for more complete API access, but instead focus on change events and include only the data that is relevant to that specific event. – dmulter Jul 01 '18 at 22:26
  • Yes, idea is to do that only. But say there could be a scenario when almost all resources are inactive then payload size will become huge. How to set a payload limit? – Sarthak Singhal Jul 02 '18 at 12:35
  • What is the case in which a resource becomes inactive.? Is it a bulk update based on some other reference value ? – Deva Gerald Jul 02 '18 at 14:15
  • Any resource can be inactive at a given point. Webhook will be triggered at a fixed frequency of say x minutes. If no resource is down, it'll just say a global status "OK", if not global status would be "WARNING" and then a list of inactive resources. – Sarthak Singhal Jul 02 '18 at 17:42

0 Answers0