An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
Hi ,
Thanks for reaching out to Microsoft Q&A.
This is a known failure pattern under heavy pending operations+unstable AMQP where the Node.js azure-iothub SDK can get into recursive error handling during reconnect storms. There is no clean bypass, so the practical workaround is to control concurrency and failure behaviour: throttle C2D sends (queue with max inflight limit instead of blasting 2K async calls), implement retry with exponential backoff+jitter outside the SDK, and cancel/timeout pending sends when the connection drops rather than letting them pile up. Also consider switching transport to AMQP over websockets (443) to avoid port blocks, and add a process level guard (uncaughtException handler+graceful restart) to prevent full crashes. If possible, upgrade or test alternate patterns (Service Bus queue ->device pull) since C2D at that scale with flaky connectivity is fragile in this SDK.
Two key questions?
- Are you firing all 2k sends concurrently or using any bounded queue/backpressure mechanism?
- Have you tested AMQP over websockets or reduced retry policy to limit recursive reconnect attempts?
Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the reply was helpful. This will be benefitting other community members who face the same issue.