The main point of the backoff strategy is to distribute the failed message through different queues where each one has a default TTL (time to live, which means for how long a message will lie in a queue) value for its messages. Obviously, before a message is retried, it should arrive through an origin queue, which is our main queue for webhooks. If all attempts to trigger a webhook fail, we should send the failed message to a final queue that will have messages for further investigation.

Now we come to the exponential side of the moon. The queue TTL will receive a calculated value based on the following exponential backoff formula:

{interval} + {current_retry_attempt} ^ 4

If we apply the formula above to generate 10 TTL values, we will end with:

Current AttemptNext Retry (seconds)Total Elapsed (seconds)
16161
276137
3141278
4361594
56851279
613562635
724615096
841569252
9662115873
101006025933