...
To avoid blocking the entire message queue when processing webhooks, it is crucial to focus on the signature validation first and handle any additional checks asynchronously.
Recommended Acknowledgment Process:
Signature Validation:
Objective: Ensure the message is legitimately sent by OneStock.
Action: If the signature is valid, immediately return an HTTP
202 Accepted
response.
Asynchronous Content Validation (if applicable):
Any additional checks (e.g., content validation) should be performed asynchronously after acknowledging the message. This prevents delays in processing subsequent webhooks and ensures a smooth message flow.
Key Benefits
Prevent Queue Blocking: By acknowledging based solely on signature validation, the message queue remains smooth and uninterrupted.
Efficient Processing: Additional content checks can be handled asynchronously, avoiding potential bottlenecks.
...
enabled
: The default state after creation. Messages are processed normally, triggering the webhook.paused
Paused:
Messages are stored while the webhook is paused, either due to anon_failure
error or manual intervention. Manual pausing prevents new messages from being processed in a paused state. The behavior of this state depends on the scenario:Manual pause: No messages will be sent until the webhook is manually re-enabled
on_failure
pausing results on messages being retried tillon_failure_recovered
oron_deactivation
.
Automatic pause: This occurs when a message is not acknowledged by the receiver within 15 seconds. In this case, the message will be retried. If the message fails to be acknowledged after the configured number of retries (
retries_until_failure
), an on_failure notification will be triggered (via email and/or SMS, depending on configuration). If the maximum number of retries is reached without success, the webhook will bedisabled
. However, if the message is acknowledged before reaching the retry limit, the webhook will automatically resume sending messages (enabled
).
disabled
: The webhook stops functioning and storing messages after anon_deactivation
error. It must be manually reactivated.
...