Home > Blockchain >  Is it possible to get runtime info about a consumer of Azure Service Bus queue?
Is it possible to get runtime info about a consumer of Azure Service Bus queue?

Time:12-09

Is it possible to determine is my Azure Service Bus queue have an active consumer or not? It's enough to get true/false for me or something like that. RabbitMQ queues have such information, for example.

I need this info cause I want to remove queues without any consumers manually via .Net code. Is it possible to do something like that based on Azure runtime info?

CodePudding user response:

You can use the ServiceBusAdministrationClient Class for managing your Azure Service Bus.

ServiceBusAdministrationClient.DeleteQueueAsync method for deleting Queues. ServiceBusAdministrationClient.GetSubscriptionRuntimePropertiesAsync method for retrieving runtime info about Subscription.

CodePudding user response:

Is it possible to determine is my Azure Service Bus queue have an active consumer or not?

Azure Service Bus does not support this feature.

While there might be a reason you're trying to get that information, messaging is there to decouple producers and consumers (or publishers and subscribers). Coupling your logic with the information, wherever there are consumers or not, might negatively affect your overall system design.

  • Related