NodeJS and Azure Service Bus Best Practices

Razvan Goga 41 Reputation points
2020-08-07T09:13:04.13+00:00

Hi,

Do the recommendations outlined here also apply to the NodeJS client?

I'm developing a long running NodeJS worker service

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
635 questions
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,531 Reputation points
    2020-08-10T03:27:31.843+00:00

    Hi @RazvanGoga-1178

    Its the recommendation for all the SDK's as establishing a connection again is an expensive operation that you can avoid by reusing the existing connection.
    In the case of nodeJS once you create the sender/receiver object you can reuse it for multiple operations.

    const sender = serviceBusClient.createSender("my-queue");
    const receiver = serviceBusClient.createReceiver("my-queue", "peekLock");

    The Service Bus library depends on the rhea-promise library for managing connections, sending, and receiving messages over the AMQP protocol.

    Reference : https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-service-bus/7.0.0-preview.4/index.html

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.