jjnguy
jjnguy

Reputation: 138874

Can I View the Filters Currently Enabled on an Azure ServiceBus Topic Subscription?

I'd like to let people change their subscription filters via an interface in my app. To do this, I need to show them which filters are currently applied to their subscription.

I cannot find anywhere in the documentation where it allows you to list the current filters.

You have the ability to AddRule and RemoveRule, but no way to list them. RemoveRule will even throw an exception if that rule already exists.

How can I determine which rules are currently being applied to my Topic Subscription?

Upvotes: 3

Views: 325

Answers (1)

b2zw2a
b2zw2a

Reputation: 2693

Yes, you can get list of rules for a specific topic and subscription through NamespaceManager.GetRules(string topicPath, string subscriptionName) :

        var rules = namespaceManager.GetRules("MyTopic", "MySubscriber");
        foreach (var ruleDescription in rules)
        {
            Console.Write(ruleDescription.Name);
            var filter = ruleDescription.Filter;
        }

Upvotes: 2

Related Questions