## System resilience 
Follow these guidelines:
* Use queues and async processing for resource-intensive operations such as third-party API calls, billing, and item granting.
* Set timeouts on the webhook handler (1–3 s). For transient failures, rely on the [Xsolla retry mechanism](/webhooks/section/webhook-listener/sending-responses-to-webhook).
* Don’t implement retries in the webhook handler — redelivery is handled by Xsolla.
* Log webhook delivery timestamps and processing statuses; set up alerts for spikes in `5xx` errors and redeliveries.
* Propagate correlation IDs from the webhook into your logs and monitoring system (APM).
* Set up error logging and monitoring. For non-recoverable failures, move jobs to a dead-letter queue (DLQ). Develop a secure tool for replaying events that is protected by an idempotency mechanism.

