Azure Service Bus Queries

Deepankar Malik 20 Reputation points
2023-11-05T23:15:53.27+00:00

Hi

I have couple of questions regarding Azure Service bus

  1. I am creating singleton object of service bus sender in .net 6 startup.cs class. Now I inject this object using constructor in my class and use it to send multiple messages to another azure service bus topic using SendMessageAsync() method. How many connections it's creating to the service bus namespace?
  2. I am getting QuoteExceededException, i have googled a lot and even saw various Microsoft posts as well but not able to figure out the exact issue. Can you provide any useful links to get more insight on this issue?
  3. I am using the Application Insights (Preview) for Azure Service bus and it shows me Connections opened = 29.28K and Connections Closed = 12.03K at a certain time. Does that mean I have 29.28K-12.03K open connections at that instance of time.?
Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
700 questions
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 29,261 Reputation points
    2023-11-06T14:26:20.09+00:00

    @Deepankar Malik Thanks for reaching out.
    When you create a singleton object of the Service Bus sender in your .NET 6 startup.cs class and inject it into your class to send multiple messages, it creates one single connection to the Service Bus namespace. This is because the Service Bus SDK manages connections efficiently under the hood, and reuses connections where possible.

    QuotaExceededException occurs when the Service Bus namespace has reached its maximum capacity for the number of messages or connections.

    For all the Quota related info please refer: https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-quotas#messaging-quotas

    Regarding the metrics "Connections Opened" and "Connections Closed" IN Application insights refers the total number of connections that were opened and closed respectively during the selected time range. It does not necessarily mean that the difference between these two values represents the number of open connections at a specific instance of time. The number of open connections at any given time would be the number of connections that have been opened but not yet closed. However, without additional information, it's not possible to determine the exact number of open connections at a specific instance of time based on these two metrics alone.

    If you need to identify the exact cause, we might have to look at your resource specifically to troubleshoot this specific issue and our support team has great tools to investigate further. Do you have Support Plan? If so, I would recommend creating one. Otherwise let me know, I can create one time request for you.

    let me know incase of further issues, I would be happy to assist you.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    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.