Retry Logic Overview
If the Encompass Platform is unable to deliver a notification to the registered webhook callback or the callback fails to acknowledge the notification, the Encompass Platform will make other attempts to deliver the notification.
The following situations are considered a failed delivery attempt:
• HTTP status outside the range 200-499.
• A request timeout (30 seconds). Note that if a request time-out occurs, the next retry will occur at the specified interval after the timeout. For example, if the retry interval is 20 seconds and a request times out, the start of the next request will be 35 seconds after the start of the request that timed-out.
• Any connection error such as connection timeout, endpoint unreachable, bad SSL certificate, etc.
HTTP response status within range of 200-499 will not be retried.
Default Retry Logic
By default, the Encompass Platform implements a linear retry policy that will attempt delivery up to three times with a delay of 20 seconds between each retry. If the event is not delivered after three attempts, the notification is discarded.
Retry Logic with Exponential Backoff
The Encompass Platform also supports an exponential back-off policy that increases the resend interval for each failure. This policy allows for a longer retry period while not attempting to deliver the request constantly. When exponential back-off is applied to a subscription, any failed events will automatically retry for 8 hours with an exponential back-off interval.
The table below shows the interval between retry attempts:
Retry Attempt | Seconds Since Original Webhook Event | Time Since Original Webhook Event |
---|---|---|
1 | 30 | 00:00:30 |
2 | 60 | 00:01:00 |
3 | 120 | 00:02:00 |
4 | 240 | 00:04:00 |
5 | 480 | 00:08:00 |
6 | 960 | 00:16:00 |
7 | 1920 | 00:32:00 |
8 | 3600 | 01:00:00 |
9 | 7200 | 02:00:00 |
10 | 10800 | 03:00:00 |
11 | 14400 | 04:00:00 |
12 | 18000 | 05:00:00 |
13 | 21600 | 06:00:00 |
14 | 25200 | 07:00:00 |
15 | 28800 | 08:00:00 |
Implement Exponential Back-Off for Webhook Subscriptions
The delivery policy for a webhook subscription is determined by the Subscription API deliveryPolicy parameter.
"deliveryPolicy":{"backoff":"linear | exponential"}
The deliveryPolicy parameter is optional. To implement exponential back-off for a webhook subscription, set the deliveryPolicy back-off parameter to “exponential”. If deliveryPolicy is not provided as input, the default retry logic, "linear", is used.
curl --location --request POST 'https://<API_SERVER>/platform/v1/events/documentOrder' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <Token>' \
--data-raw '{
{ "endpoint": "<clientEndPoint>", "resource": "Loan", "events": ["create", "change", "update" ], "filters":{ "attributes":["/applications/0/borrower/firstName"] }, "deliveryPolicy":{"backoff":"exponential"} }
}'