I am running an Azure function on NodeJS that reads ~4K records from a SQL Server database and sends them to a Service Bus queue using the 'azure-sb' sdk.
If I send the messages sequentially it is too slow. If I use async queues to send many messages in parallel it can go very fast, but it eventually some messages start throwing this error:
Executed 'Functions.test-function' (Failed, Id=329f0443-e8f6-42ed-92ae-0e9035511635) [08/31/2018 09:04:26] System.Private.CoreLib: Exception while executing function: Functions.test-function. System.Private.CoreLib: Result: Failure [08/31/2018 09:04:26] Exception: Error: getaddrinfo ENOTFOUND xxxxxxxxx.servicebus.windows.net xxxxxxxxxx.servicebus.windows.net:443 [08/31/2018 09:04:26] Stack: Error: getaddrinfo ENOTFOUND xxxxxxxxxx.servicebus.windows.net xxxxxxxxx.servicebus.windows.net:443 [08/31/2018 09:04:26] at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:50:26).
How can I achieve high throughput with the NodeJS SDK?