Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How are brokered connections counted?

Looking at Azure Service Bus to replace some unreliable RabbitMQ servers and the one thing that isn't clear about the pricing is what exactly do they count as a "Brokered connection" for billing purposes?

We have about a dozen machines that are processing messages off over 1,000 queues (and one machine populating the queue), so does 1 application running on 1 machine count as one brokered connection (regardless of how many queues it's listening to)? Or would each machine count as 1,000+ brokered connections (which could add up very quickly)?

So let's say I did something like this:

var queues = queueNames.Select(q =>
{
    if (!manager.QueueExists(q))
    {
        manager.CreateQueue(q);
    }
    return new QueueClient(ServiceBusConnectionString, q);
}).ToArray();

Add queueNames is an array of, let's say, 10 strings. Is that 10 brokered connections? 1 ? Or something else?

like image 948
Matt Burland Avatar asked Apr 23 '18 13:04

Matt Burland


1 Answers

The polling of the queue encounters the cost for a brokered connection when you hold the queue connection open and sit waiting for a message (eg if you kept the queue open for 30 seconds waiting for a message). If you use the default zero timeout (which will just return null when there is no message to receive) it doesn't count as a brokered connection. An example of a non zero timeout would be using something like Receive(TimeSpan) where you wait for the timeout specified.

You could use OnMessageAsync to listen for messages rather than polling, which doesn't look like a brokered connection.

As for how its calculated, looks like this is concurrent connections averaged hourly over the month. There are some good example calculations in the pricing guide.

From this pricing guide

A brokered connection is defined as one of the following:

  • An AMQP connection from a client to a Service Bus queue or topic/subscription.

  • An HTTP call to receive a message from a Service Bus topic or queue that has a receive timeout value greater than zero.

Service Bus charges for the peak number of concurrent brokered connections that exceed the included quantity (1,000 in the Standard tier). Peaks are measured on an hourly basis, prorated by dividing by 744 hours in a month, and added up over the monthly billing period. The included quantity (1,000 brokered connections per month) is applied at the end of the billing period against the sum of the prorated hourly peaks.

You should probably confirm this with the Azure team via support in the billing Portal, they are generally pretty good with requests like these.

like image 161
Jamie Pollard Avatar answered Sep 18 '22 14:09

Jamie Pollard