[英]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. 您可以使用
AddRule
和RemoveRule
,但无法列出它们。 RemoveRule
will even throw an exception if that rule already exists. 如果该规则已存在,则
RemoveRule
甚至会抛出异常。
How can I determine which rules are currently being applied to my Topic Subscription? 如何确定当前正在应用于我的主题订阅的规则?
Yes, you can get list of rules for a specific topic and subscription through NamespaceManager.GetRules(string topicPath, string subscriptionName)
: 是的,您可以通过
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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.