Hi @huo900! Shreya from Dwolla’s DevRel team here. Thanks for posting!
What you’re seeing is a common issue when webhook listeners are running in environments under heavy load.
A few best practices from our docs may help:
1. Keep the webhook handler lightweight
Your endpoint should do minimal work before responding. We recommend validating the request and immediately returning a 200 OK, then processing the payload asynchronously.
2. Use a queue for processing
A typical pattern is:
Dwolla webhook → webhook endpoint → queue → background worker
The endpoint acknowledges the request quickly while the worker handles heavier processing (DB updates, notifications, etc.).
3. Respond within 10 seconds
Your endpoint must return a 2xx response within 10 seconds. If it doesn’t, the delivery is considered a failure and Dwolla will retry automatically (up to 8 times over ~72 hours).
4. Handle duplicates and ordering
Webhooks are asynchronous and may arrive out of order or be retried, so your processing should be idempotent.
5. Avoid mobile/client-side listeners
Running a webhook listener on a mobile device or heavily loaded client can lead to timeouts like you described. Webhook endpoints should run on a stable server-side service, with the mobile app receiving updates from your backend.
Summary: host the webhook on a server, return 200 OK quickly, and queue the event for background processing. This will make webhook handling much more reliable during high resource usage.
Hope this helps! Please let us know if you have any questions on any of the above!