Azure / azure-service-bus-dotnet

☁️ .NET Standard client library for Azure Service Bus
https://azure.microsoft.com/services/service-bus
Other
235 stars 120 forks source link

Restrict max concurrent messages across multiple receivers (of different queues) #689

Closed johnknoop closed 5 years ago

johnknoop commented 5 years ago

I'm not sure if this might be completely impossible to achieve, but here's an idea:

We're running an AspNetCore application and hosted inside it are a couple of background services consuming messages off various queues/subscriptions. Now, since this runs on a 2-core VM, it would be nice if at least one of them was always free to handle HTTP requests. Even if I set MaxConcurrentMessages to 1 for all our receiverclients, the mere fact that we have 5-6 receiverclients listening for messages means that they can easily consume all the system resources, making the AspNet app less responsive.

In the future, most of these background services will move out of the web app, but until then, is there anyway to restrict the maximum concurrent messages of all receiverclients? Or would that simply be to complicated to synchronize?

Thanks

axisc commented 5 years ago

@johnknoop - don't think there is a better/scaleable way than to move these services from the web app for separation of concerns between the apps.