Description
Currently, webhook notifications for completed on-chain transactions are sent in-line in each processing module that implements it (via a common BaseWebhookService). This processing (duplicated at each call site) does the following:
for (configurable retry count) {
try {
call `BaseWebhookService`
break
} catch (err) {
increment retry counter
}
}
- Although
BaseWebhookService monitors the health endpoint of the webhook server, that status is not used anywhere to inform the try/retry logic
- The retry attempts happen immediately with no exponential backoff
- There is no mitigation/recovery/retry path beyond the configured retry attempts
Suggested Enhancements
- Move this logic into a
BaseWebhookService method
- Re-implement using a queue & worker (perhaps make
BaseWebhookService the worker?)
- Implement exponential backoff
- Do not attempt to send a notification (and fail) if the service is known to be unhealthy
- Ensure that the periodic health check is started when the service is unhealthy
Description
Currently, webhook notifications for completed on-chain transactions are sent in-line in each processing module that implements it (via a common
BaseWebhookService). This processing (duplicated at each call site) does the following:BaseWebhookServicemonitors the health endpoint of the webhook server, that status is not used anywhere to inform the try/retry logicSuggested Enhancements
BaseWebhookServicemethodBaseWebhookServicethe worker?)