Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleting dead topics in Azure Service Bus

I've tried to do my homework on this issue but no searches I can make have gotten me closer to the answer. Closest hit was Detect and Delete Orphaned Queues, Topics, or Subscriptions on Azure Service Bus.

My scenario:

I have multiple services running (standard win service). At startup these processes starts to subscribe to a given topic in Azure Service Bus. Let's call the topic "Messages".

When the service is shut down it unsubcribes in a nice way.

But sometimes stuff happens and the service crashes, causing the unsubscription to fail and the subscription then is left hanging.

My questions:

1) From what I'm seeing, each dead topic subscription counts when a message is sent to that topic. Even if no one is ever going to pick it up. Fact or fiction?

2) Is there anyway to remove subscriptions that haven't been checked for a while, for example for the last 24h? Preferrably by a Power Shell script?

I've raised this issue directly with Microsoft but haven't received any answer yet. Surely, I can't be the first to experience this. I'll also update this if I get any third party info.

Thanks

Johan

like image 398
Johan Karlsson Avatar asked Dec 08 '22 15:12

Johan Karlsson


1 Answers

In the Azure SDK 2.0 release we have addressed this scenario with the AutoDeleteOnIdle feature. This will allow you to set a timespan on a Queue/Topic/Subscription and the when no activity is detected for the specified duration, the entity will automatically be deleted. See details here, and the property to set is here.

like image 164
Abhishek Lal Avatar answered Dec 12 '22 22:12

Abhishek Lal