다음을 통해 공유


SubscriptionClient.AddRuleAsync Method

Definition

Overloads

AddRuleAsync(RuleDescription)

Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.

AddRuleAsync(String, Filter)

Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.

AddRuleAsync(RuleDescription)

Source:
SubscriptionClient.cs

Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.

public System.Threading.Tasks.Task AddRuleAsync (Microsoft.Azure.ServiceBus.RuleDescription description);
abstract member AddRuleAsync : Microsoft.Azure.ServiceBus.RuleDescription -> System.Threading.Tasks.Task
override this.AddRuleAsync : Microsoft.Azure.ServiceBus.RuleDescription -> System.Threading.Tasks.Task
Public Function AddRuleAsync (description As RuleDescription) As Task

Parameters

description
RuleDescription

The rule description that provides the rule to add.

Returns

A task instance that represents the asynchronous add rule operation.

Implements

Remarks

You can add rules to the subscription that decides which messages from the topic should reach the subscription. A default TrueFilter rule named DefaultRuleName is always added while creation of the Subscription. You can add multiple rules with distinct names to the same subscription. Multiple filters combine with each other using logical OR condition. i.e., If any filter succeeds, the message is passed on to the subscription.

Applies to

AddRuleAsync(String, Filter)

Source:
SubscriptionClient.cs

Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.

public System.Threading.Tasks.Task AddRuleAsync (string ruleName, Microsoft.Azure.ServiceBus.Filter filter);
abstract member AddRuleAsync : string * Microsoft.Azure.ServiceBus.Filter -> System.Threading.Tasks.Task
override this.AddRuleAsync : string * Microsoft.Azure.ServiceBus.Filter -> System.Threading.Tasks.Task
Public Function AddRuleAsync (ruleName As String, filter As Filter) As Task

Parameters

ruleName
String
filter
Filter

The filter expression against which messages will be matched.

Returns

A task instance that represents the asynchronous add rule operation.

Implements

Remarks

You can add rules to the subscription that decides which messages from the topic should reach the subscription. A default TrueFilter rule named DefaultRuleName is always added while creation of the Subscription. You can add multiple rules with distinct names to the same subscription. Multiple filters combine with each other using logical OR condition. i.e., If any filter succeeds, the message is passed on to the subscription. Max allowed length of rule name is 50 chars.

Applies to