SALES: 1-800-867-1380

SubscriptionClient.AddRule Method (String, Filter)

Adds a rule to the current subscription with the specified name and filter expression.

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

public void AddRule(
	string ruleName,
	Filter filter
)

Parameters

ruleName
Type: System.String
The name of the rule to add.
filter
Type: Microsoft.ServiceBus.Messaging.Filter
The filter expression against which messages will be matched.

ExceptionCondition
ArgumentNullException

Thrown if filter is null.

ArgumentException

Thrown if ruleName is null, white space empty or not in the right format.

ArgumentOutOfRangeException

Thrown if ruleName length has exceeded the limit of 50 characters.

TimeoutException

Thrown if the operation exceeded the timeout value set via OperationTimeout.

OperationCanceledException

Thrown if the client entity has been closed or aborted.

MessagingEntityAlreadyExistsException

Thrown if the rule with the same name as ruleName already existed for this subscription.

MessagingEntityAlreadyExistsException

Thrown when an attempt is made to add another rule with same name as one that has already been added.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft