I have written code (Node Js) by which i receive a message and send it to the Service Bus Queue. But when i test it with 5000 messages in a loop it fails with only a few over 1000 messages in queue.
It fails with the concurrency
Here is my message code function in message.js file
queueMessage = (messageBody) => {
async function main()
{
try{
const sbClient = ServiceBusClient.createFromConnectionString(connectionString);
const queueClient = sbClient.createQueueClient(queueName)
const sender = queueClient.createSender();
sender.send({
body:messageBody,
// sessionId:'my-session'
});
console.log('message sent to the queue')
}
catch(err){
console.log(err)
}
}
main()
.catch(err=>console.log(err))
}