0
  • 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))


}
Amaan Imtiyaz
  • 254
  • 6
  • 16
  • How many threads did you use? Could you share more test configure about Jmeter? Any screenshots would be helpful. – Jack Jia Jan 21 '20 at 09:14
  • 1
    Where is the loop coming in to play? If you are looping the whole `main()` method then you are creating a Service Bus connection each time and not closing it. Since Service Bus maxes out at 1000 concurrent connections for most protocols, that would explain why you are failing at that point specifically. https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-performance-improvements – PerfectlyPanda Jan 21 '20 at 17:54

0 Answers0