SubscriptionClient SubscriptionClient Class

Definition

Represents the anchor class used in run-time operations related to a topic subscription.

public abstract class SubscriptionClient : ClientEntity, ICloseable, IMessageSessionEntity, IMessageClientEntity, IMessageReceiver, IMessageBrowserPublic MustInherit Class SubscriptionClient
    Inherits ClientEntity
    Implements ICloseable, IMessageSessionEntity, IMessageClientEntity, IMessageReceiver, IMessageBrowser
Inheritance
SubscriptionClientSubscriptionClient

Inherited Members

Microsoft.ServiceBus.Messaging.ClientEntity

System.Object

Examples

// Create subscription client
SubscriptionClient mySubscriptionClient = 
factory.CreateSubscriptionClient(mySubscription);

// Receive messages
for (int count = 0; count < MsgCount; count++)
{
    var message = mySubscriptionClient.Receive();
    message.Complete();
}

Properties

MessagingFactory MessagingFactory

Gets the messaging factory used to create this subscription client.

public MessagingFactory MessagingFactory { get; }Public ReadOnly Property MessagingFactory As MessagingFactory
Value
MessagingFactory MessagingFactory

The messaging factory used to create this subscription client.

Mode Mode

Gets the message receive mode when processing the received message.

public ReceiveMode Mode { get; }Public ReadOnly Property Mode As ReceiveMode
Value
ReceiveMode ReceiveMode

The message ReceiveMode when processing the received message.

Name Name

Gets the name of the subscription.

public string Name { get; }Public ReadOnly Property Name As String
Value
String String

The name of the subscription.

PrefetchCount PrefetchCount

Gets or sets the number of messages that the message receiver can simultaneously request.

public int PrefetchCount { get; set; }Public Property PrefetchCount As Integer
Value
Int32 Int32

The number of messages that the message receiver can simultaneously request.

Remarks

Takes effect on the next receive call to the server.

TopicPath TopicPath

Gets the full pathname of the topic.

public string TopicPath { get; }Public ReadOnly Property TopicPath As String
Value
String String

The full pathname of the topic.

Methods

Abandon(Guid) Abandon(Guid)

Discards the message and relinquishes the message lock ownership.

public void Abandon(Guid lockToken)Public Sub Abandon(lockToken As Guid)
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance to abandon.

Exceptions

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

Thrown if the client entity has been closed or aborted.

Remarks

When the client fails to get the message from the queue/topic, this method should be called. Service Bus will increment the delivery count of the message. The client now can either attempt to receive the message again or move it to the dead-letter queue.

Abandon(Guid, IDictionary<String, Object>) Abandon(Guid, IDictionary(Of String, Object))

Discards the message and relinquishes the message lock ownership.

public void Abandon(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Sub Abandon(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object))
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance to abandon.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

A collection of property objects to be modified.

Remarks

When the client fails to get the message from the queue/topic, this method should be called. Service Bus will increment the delivery count of the message. The client now can either attempt to receive the message again or move it to the dead-letter queue.

AbandonAsync(Guid) AbandonAsync(Guid)

Asynchronously discards the message and relinquishes the message lock ownership.

public Task AbandonAsync(Guid lockToken)Public Function AbandonAsync(lockToken As Guid) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance to abandon.

Returns

A task instance that represents the asynchronous abandon operation.

AbandonAsync(Guid, IDictionary<String, Object>) AbandonAsync(Guid, IDictionary(Of String, Object))

Asynchronously discards the message and relinquishes the message lock ownership.

public Task AbandonAsync(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Function AbandonAsync(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object)) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance to abandon.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

A collection of property objects to be modified.

Returns

A task instance that represents the asynchronous abandon operation.

AcceptMessageSession() AcceptMessageSession()

Accepts a message session that allows grouping of related messages for processing in a single transaction.

public MessageSession AcceptMessageSession()Public Function AcceptMessageSession As MessageSession
Returns

A MessageSession that allows grouping of related messages for processing in a single transaction.

AcceptMessageSession(String) AcceptMessageSession(String)

Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier.

public MessageSession AcceptMessageSession(string sessionId)Public Function AcceptMessageSession(sessionId As String) As MessageSession
Parameters
sessionId
String String

The session identifier of the message session.

Returns

A MessageSession that allows grouping of related messages for processing in a single transaction.

Exceptions

Thrown if sessionId is null, empty, or white spaces.

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

Thrown if the client is already closed, aborted, or disposed.

AcceptMessageSession(String, TimeSpan) AcceptMessageSession(String, TimeSpan)

Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier and wait time.

public MessageSession AcceptMessageSession(string sessionId, TimeSpan serverWaitTime)Public Function AcceptMessageSession(sessionId As String, serverWaitTime As TimeSpan) As MessageSession
Parameters
sessionId
String String

The session identifier of the message session.

serverWaitTime
TimeSpan TimeSpan

The time span the server waits for processing messages before it times out.

Returns

A MessageSession that allows grouping of related messages for processing in a single transaction.

Exceptions

Thrown if sessionId is null, empty, or white spaces.

Thrown if serverWaitTime is not a positive TimeSpan value.

Thrown if the operation exceeded the timeout value set by serverWaitTime.

Thrown if the client is already closed, aborted, or disposed.

AcceptMessageSession(TimeSpan) AcceptMessageSession(TimeSpan)

Accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.

public MessageSession AcceptMessageSession(TimeSpan serverWaitTime)Public Function AcceptMessageSession(serverWaitTime As TimeSpan) As MessageSession
Parameters
serverWaitTime
TimeSpan TimeSpan

The time span the server waits for processing messages before it times out.

Returns

A MessageSession that allows grouping of related messages for processing in a single transaction.

Exceptions

Thrown if serverWaitTime is not a positive TimeSpan value.

Thrown if the operation exceeded the timeout value set by serverWaitTime.

Thrown if the client is already closed, aborted, or disposed.

AcceptMessageSessionAsync() AcceptMessageSessionAsync()

Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.

public Task<MessageSession> AcceptMessageSessionAsync()Public Function AcceptMessageSessionAsync As Task(Of MessageSession)
Returns

A task instance that represents the asynchronous accept message session operation.

AcceptMessageSessionAsync(String) AcceptMessageSessionAsync(String)

Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.

public Task<MessageSession> AcceptMessageSessionAsync(string sessionId)Public Function AcceptMessageSessionAsync(sessionId As String) As Task(Of MessageSession)
Parameters
sessionId
String String

The session identifier of the message session.

Returns

A task instance that represents the asynchronous accept message session operation.

AcceptMessageSessionAsync(String, TimeSpan) AcceptMessageSessionAsync(String, TimeSpan)

Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.

public Task<MessageSession> AcceptMessageSessionAsync(string sessionId, TimeSpan serverWaitTime)Public Function AcceptMessageSessionAsync(sessionId As String, serverWaitTime As TimeSpan) As Task(Of MessageSession)
Parameters
sessionId
String String

The session identifier of the message session.

serverWaitTime
TimeSpan TimeSpan

The time span the server waits for processing messages before it times out.

Returns

A task instance that represents the asynchronous accept message session operation.

AcceptMessageSessionAsync(TimeSpan) AcceptMessageSessionAsync(TimeSpan)

Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time.

public Task<MessageSession> AcceptMessageSessionAsync(TimeSpan serverWaitTime)Public Function AcceptMessageSessionAsync(serverWaitTime As TimeSpan) As Task(Of MessageSession)
Parameters
serverWaitTime
TimeSpan TimeSpan

The time span the server waits for processing messages before it times out.

Returns

A task instance that represents the asynchronous accept message session operation.

AddRule(RuleDescription) AddRule(RuleDescription)

Adds a new rule to the SubscriptionDescription using the specified rule description.

public void AddRule(RuleDescription description)Public Sub AddRule(description As RuleDescription)
Parameters
description
RuleDescription RuleDescription

The rule description that provides metadata of the rule to add.

Exceptions

Thrown if description is null.

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

Thrown if description.Name.Name length has exceeded the limit of 50 characters.

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

Thrown if the client entity has been closed or aborted.

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

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

AddRule(String, Filter) AddRule(String, Filter)

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

public void AddRule(string ruleName, Filter filter)Public Sub AddRule(ruleName As String, filter As Filter)
Parameters
ruleName
String String

The name of the rule to add.

filter
Filter Filter

The filter expression against which messages will be matched.

Exceptions

Thrown if filter is null.

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

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

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

Thrown if the client entity has been closed or aborted.

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

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

AddRuleAsync(RuleDescription) AddRuleAsync(RuleDescription)

Asynchronously adds a new rule to the SubscriptionDescription using the specified rule description.

public Task AddRuleAsync(RuleDescription description)Public Function AddRuleAsync(description As RuleDescription) As Task
Parameters
description
RuleDescription RuleDescription

The rule description that provides metadata of the rule to add.

Returns

A task instance that represents the asynchronous add rule operation.

AddRuleAsync(String, Filter) AddRuleAsync(String, Filter)

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

public Task AddRuleAsync(string ruleName, Filter filter)Public Function AddRuleAsync(ruleName As String, filter As Filter) As Task
Parameters
ruleName
String String

The name of the rule to add.

filter
Filter Filter

The filter expression against which messages will be matched.

Returns

A task instance that represents the asynchronous add rule operation.

Complete(Guid) Complete(Guid)

Completes processing of a message.

public void Complete(Guid lockToken)Public Sub Complete(lockToken As Guid)
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

Exceptions

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

Thrown if the client entity has been closed or aborted.

Thrown if the message represented by lockToken has lost the message lock.

Remarks

This method is used as a handshake between the client and Service Bus for a guaranteed delivery of the message. If the client failed before calling this method, the message will be kept in the queue.

CompleteAsync(Guid) CompleteAsync(Guid)

Asynchronously completes processing of a message.

public Task CompleteAsync(Guid lockToken)Public Function CompleteAsync(lockToken As Guid) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

Returns

A task instance that represents the asynchronous complete operation.

CompleteBatch(IEnumerable<Guid>) CompleteBatch(IEnumerable(Of Guid))

Completes processing of a batch.

public void CompleteBatch(IEnumerable<Guid> lockTokens)Public Sub CompleteBatch(lockTokens As IEnumerable(Of Guid))
Parameters
lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens bound to the locked message instance.

Remarks

This method is used as a handshake between the client and Service Bus for a guaranteed delivery of the message. If the client failed before calling this method, the message will be kept in the queue.

CompleteBatchAsync(IEnumerable<Guid>) CompleteBatchAsync(IEnumerable(Of Guid))

Asynchronously completes processing of a batch.

public Task CompleteBatchAsync(IEnumerable<Guid> lockTokens)Public Function CompleteBatchAsync(lockTokens As IEnumerable(Of Guid)) As Task
Parameters
lockTokens
IEnumerable<Guid> IEnumerable(Of Guid)

The lock tokens bound to the locked message instance.

Returns

A task instance that represents the asynchronous complete batch operation.

Create(String, String) Create(String, String)

Creates a new copy of SubscriptionClient with specified name and topic path.

public static SubscriptionClient Create(string topicPath, string name)Public Shared Function Create(topicPath As String, name As String) As SubscriptionClient
Parameters
topicPath
String String

The full pathname of the topic.

name
String String

The name of the subscription.

Returns

Create(String, String, ReceiveMode) Create(String, String, ReceiveMode)

Creates a new copy of SubscriptionClient with specified name, topic path and mode.

public static SubscriptionClient Create(string topicPath, string name, ReceiveMode mode)Public Shared Function Create(topicPath As String, name As String, mode As ReceiveMode) As SubscriptionClient
Parameters
topicPath
String String

The full pathname of the topic.

name
String String

The name of the subscription.

mode
ReceiveMode ReceiveMode

The message receive mode.

Returns

CreateFromConnectionString(String, String, String) CreateFromConnectionString(String, String, String)

Creates a new copy of SubscriptionClient from a connection string with specified topic path and name.

public static SubscriptionClient CreateFromConnectionString(string connectionString, string topicPath, string name)Public Shared Function CreateFromConnectionString(connectionString As String, topicPath As String, name As String) As SubscriptionClient
Parameters
connectionString
String String

The connection string.

topicPath
String String

The full pathname of the topic.

name
String String

The name of the subscription.

Returns

CreateFromConnectionString(String, String, String, ReceiveMode) CreateFromConnectionString(String, String, String, ReceiveMode)

Creates a new copy of SubscriptionClient from a connection string with specified topic path, name and mode.

public static SubscriptionClient CreateFromConnectionString(string connectionString, string topicPath, string name, ReceiveMode mode)Public Shared Function CreateFromConnectionString(connectionString As String, topicPath As String, name As String, mode As ReceiveMode) As SubscriptionClient
Parameters
connectionString
String String

The connection string.

topicPath
String String

The full pathname of the topic.

name
String String

The name of the subscription.

mode
ReceiveMode ReceiveMode

The message receive mode.

Returns

DeadLetter(Guid) DeadLetter(Guid)

Moves the undelivered message to the dead letter queue.

public void DeadLetter(Guid lockToken)Public Sub DeadLetter(lockToken As Guid)
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

Exceptions

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

Thrown if the client entity has been closed or aborted.

Thrown if the message represented by lockToken has lost the message lock.

DeadLetter(Guid, IDictionary<String, Object>) DeadLetter(Guid, IDictionary(Of String, Object))

Moves the undelivered message to the dead letter queue.

public void DeadLetter(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Sub DeadLetter(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object))
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

DeadLetter(Guid, String, String) DeadLetter(Guid, String, String)

Moves the undelivered message to the dead letter queue.

public void DeadLetter(Guid lockToken, string deadLetterReason, string deadLetterErrorDescription)Public Sub DeadLetter(lockToken As Guid, deadLetterReason As String, deadLetterErrorDescription As String)
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

deadLetterReason
String String

The reason for deadlettering the message.

deadLetterErrorDescription
String String

The error description for deadlettering the message.

Exceptions

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

Thrown if the client entity has been closed or aborted.

Thrown if the message represented by lockToken has lost the message lock.

DeadLetterAsync(Guid) DeadLetterAsync(Guid)

Asynchronously moves the undelivered message to the dead letter queue.

public Task DeadLetterAsync(Guid lockToken)Public Function DeadLetterAsync(lockToken As Guid) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

Returns

A task instance that represents the asynchronous deadletter operation.

DeadLetterAsync(Guid, IDictionary<String, Object>) DeadLetterAsync(Guid, IDictionary(Of String, Object))

Asynchronously moves the undelivered message to the dead letter queue.

public Task DeadLetterAsync(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Function DeadLetterAsync(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object)) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

Returns

A task instance that represents the asynchronous deadletter operation.

DeadLetterAsync(Guid, String, String) DeadLetterAsync(Guid, String, String)

Asynchronously moves the undelivered message to the dead letter queue.

public Task DeadLetterAsync(Guid lockToken, string deadLetterReason, string deadLetterErrorDescription)Public Function DeadLetterAsync(lockToken As Guid, deadLetterReason As String, deadLetterErrorDescription As String) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

deadLetterReason
String String

The reason for deadlettering the message.

deadLetterErrorDescription
String String

The error description for deadlettering the message.

Returns

A task instance that represents the asynchronous deadletter operation.

Defer(Guid) Defer(Guid)

Suspends the processing of a message.

public void Defer(Guid lockToken)Public Sub Defer(lockToken As Guid)
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

Exceptions

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

Thrown if the client entity has been closed or aborted.

Thrown if the message represented by lockToken has lost the message lock.

Remarks

Before deferring, you should set aside the message receipt for later retrieval.

Defer(Guid, IDictionary<String, Object>) Defer(Guid, IDictionary(Of String, Object))

Suspends the processing of a message.

public void Defer(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Sub Defer(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object))
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

Remarks

Before deferring, you should set aside the message receipt for later retrieval.

DeferAsync(Guid) DeferAsync(Guid)

Asynchronously suspends the processing of a message.

public Task DeferAsync(Guid lockToken)Public Function DeferAsync(lockToken As Guid) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

Returns

A task instance that represents the asynchronous defer operation.

DeferAsync(Guid, IDictionary<String, Object>) DeferAsync(Guid, IDictionary(Of String, Object))

Asynchronously suspends the processing of a message.

public Task DeferAsync(Guid lockToken, IDictionary<string, object> propertiesToModify)Public Function DeferAsync(lockToken As Guid, propertiesToModify As IDictionary(Of String, Object)) As Task
Parameters
lockToken
Guid Guid

The lock token bound to the locked message instance.

propertiesToModify
IDictionary<String, Object> IDictionary(Of String, Object)

The properties to modify.

Returns

A task instance that represents the asynchronous defer operation.

FormatDeadLetterPath(String, String) FormatDeadLetterPath(String, String)

Builds a format name deadletter path using the specified topic path and subscription name.

public static string FormatDeadLetterPath(string topicPath, string subscriptionName)Public Shared Function FormatDeadLetterPath(topicPath As String, subscriptionName As String) As String
Parameters
topicPath
String String

The full pathname of the topic.

subscriptionName
String String

The name of the subscription.

Returns

The String resulted from building the format name deadletter path using the specified topic path and subscription name.

FormatSubscriptionPath(String, String) FormatSubscriptionPath(String, String)

Builds a format name subscription path using the specified topic path and subscription name.

public static string FormatSubscriptionPath(string topicPath, string subscriptionName)Public Shared Function FormatSubscriptionPath(topicPath As String, subscriptionName As String) As String
Parameters
topicPath
String String

The full pathname of the topic.

subscriptionName
String String

The name of the subscription.

Returns

The String resulted from building the format name subscription path using the specified topic path and subscription name.

GetMessageSessions() GetMessageSessions()

Gets a message session that allows grouping of related messages for processing in a single transaction.

public IEnumerable<MessageSession> GetMessageSessions()Public Function GetMessageSessions As IEnumerable(Of MessageSession)
Returns

A message session that allows grouping of related messages for processing in a single transaction.

GetMessageSessions(DateTime) GetMessageSessions(DateTime)

Retrieves all message sessions whose session state was updated since lastUpdatedTime.

public IEnumerable<MessageSession> GetMessageSessions(DateTime lastUpdatedTime)Public Function GetMessageSessions(lastUpdatedTime As Date) As IEnumerable(Of MessageSession)
Parameters
lastUpdatedTime
DateTime DateTime

The time the session was last updated.

Returns

A message session that allows grouping of related messages for processing in a single transaction.

GetMessageSessionsAsync() GetMessageSessionsAsync()

Asynchronously gets a message session that allows grouping of related messages for processing in a single transaction.

public Task<IEnumerable<MessageSession>> GetMessageSessionsAsync()Public Function GetMessageSessionsAsync As Task(Of IEnumerable(Of MessageSession))
Returns

A task instance that represents the asynchronous get message sessions operation.

GetMessageSessionsAsync(DateTime) GetMessageSessionsAsync(DateTime)

Asynchronously gets a message session that allows grouping of related messages for processing in a single transaction.

public Task<IEnumerable<MessageSession>> GetMessageSessionsAsync(DateTime lastUpdatedTime)Public Function GetMessageSessionsAsync(lastUpdatedTime As Date) As Task(Of IEnumerable(Of MessageSession))
Parameters
lastUpdatedTime
DateTime DateTime

The time the session was last updated.

Returns

A task instance that represents the asynchronous get message sessions operation.

OnAbort() OnAbort()

Executes the abort action.

protected override void OnAbort()Protected Overrides Sub OnAbort
Overrides

OnBeginAcceptMessageSession(String, ReceiveMode, TimeSpan, TimeSpan, AsyncCallback, Object) OnBeginAcceptMessageSession(String, ReceiveMode, TimeSpan, TimeSpan, AsyncCallback, Object)

Executes upon calling the BeginAcceptMessageSession operation.

protected abstract IAsyncResult OnBeginAcceptMessageSession(string sessionId, ReceiveMode receiveMode, TimeSpan serverWaitTime, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginAcceptMessageSession(sessionId As String, receiveMode As ReceiveMode, serverWaitTime As TimeSpan, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
sessionId
String String

The session identifier of the message session.

receiveMode
ReceiveMode ReceiveMode

The receive mode when processing with the receive messages.

serverWaitTime
TimeSpan TimeSpan

The time span the server waits for processing messages before it times out

timeout
TimeSpan TimeSpan

The time span the server waits for processing messages before it times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

An IAsyncResult that references the asynchronous operation to accept a message session.

OnBeginAddRule(RuleDescription, TimeSpan, AsyncCallback, Object) OnBeginAddRule(RuleDescription, TimeSpan, AsyncCallback, Object)

Executes upon calling the BeginAddRule operation.

protected abstract IAsyncResult OnBeginAddRule(RuleDescription description, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginAddRule(description As RuleDescription, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
description
RuleDescription RuleDescription

The rule description that provides metadata of the rule to add.

timeout
TimeSpan TimeSpan

The time span this operation waits before it times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

An IAsyncResult that references the asynchronous operation to add a new rule to the subscription.

OnBeginClose(TimeSpan, AsyncCallback, Object) OnBeginClose(TimeSpan, AsyncCallback, Object)

Executes the begin close action.

protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state)Protected Overrides Function OnBeginClose(timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
timeout
TimeSpan TimeSpan

The wait time before the operation times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains information about the receive operation. This object is passed to the BeginClose delegate when the operation is complete.

Returns

An IAsyncResultthat references the asynchronous BeginClose.

Overrides

OnBeginCreateReceiver(ReceiveMode, TimeSpan, AsyncCallback, Object) OnBeginCreateReceiver(ReceiveMode, TimeSpan, AsyncCallback, Object)

Executes the begin create receiver action.

protected abstract IAsyncResult OnBeginCreateReceiver(ReceiveMode receiveMode, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginCreateReceiver(receiveMode As ReceiveMode, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
receiveMode
ReceiveMode ReceiveMode

The message ReceiveMode.

timeout
TimeSpan TimeSpan

The wait time before the operation times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains information about the receive operation. This object is passed to the Microsoft.ServiceBus.Messaging.SubscriptionClient.EndCreateReceiver(System.IAsyncResult) delegate when the operation is complete.

Returns

An IAsyncResult that references the asynchronous parent method.

OnBeginCreateReceiver(String, String, ReceiveMode, TimeSpan, AsyncCallback, Object) OnBeginCreateReceiver(String, String, ReceiveMode, TimeSpan, AsyncCallback, Object)

Executes the begin create receiver action.

protected abstract IAsyncResult OnBeginCreateReceiver(string subQueuePath, string subQueueName, ReceiveMode receiveMode, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginCreateReceiver(subQueuePath As String, subQueueName As String, receiveMode As ReceiveMode, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
subQueuePath
String String

The path of the subqueue.

subQueueName
String String

The name of the subqueue.

receiveMode
ReceiveMode ReceiveMode

The message ReceiveMode.

timeout
TimeSpan TimeSpan

The wait time before the operation times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains information about the receive operation. This object is passed to the Microsoft.ServiceBus.Messaging.SubscriptionClient.EndCreateReceiver(System.IAsyncResult) delegate when the operation is complete.

Returns

An IAsyncResult that references the asynchronous parent async method.

OnBeginGetMessageSessions(DateTime, AsyncCallback, Object) OnBeginGetMessageSessions(DateTime, AsyncCallback, Object)

Executes upon calling the BeginGetMessageSessions operation.

protected abstract IAsyncResult OnBeginGetMessageSessions(DateTime lastUpdatedTime, AsyncCallback callback, object state)Protected MustOverride Function OnBeginGetMessageSessions(lastUpdatedTime As Date, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
lastUpdatedTime
DateTime DateTime

The time the session was last updated.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains state information about the asynchronous operation.

Returns

An IAsyncResult that references the asynchronous operation to add a new rule to the subscription.

OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object) OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object)

Begins removing a RuleDescription from a SubscriptionDescription through the run-time client protocol.

protected abstract IAsyncResult OnBeginRemoveRule(string ruleName, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginRemoveRule(ruleName As String, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
ruleName
String String

The name of the rule to remove.

timeout
TimeSpan TimeSpan

The wait time before the operation times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains information about the receive operation. This object is passed to the RemoveRule(String) delegate when the operation is complete.

Returns

An IAsyncResult that references the asynchronous RemoveRule(String).

OnBeginRemoveRulesByTag(String, TimeSpan, AsyncCallback, Object) OnBeginRemoveRulesByTag(String, TimeSpan, AsyncCallback, Object)

Begins removing a RuleDescription from a SubscriptionDescription through the run-time client protocol using a tag.

protected abstract IAsyncResult OnBeginRemoveRulesByTag(string tag, TimeSpan timeout, AsyncCallback callback, object state)Protected MustOverride Function OnBeginRemoveRulesByTag(tag As String, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
tag
String String

The tag to be used.

timeout
TimeSpan TimeSpan

The wait time before the operation times out.

callback
AsyncCallback AsyncCallback

An AsyncCallback delegate that references the method to invoke when the operation is complete.

state
Object Object

A user-defined object that contains information about the receive operation. This object is passed to the RemoveRule(String) delegate when the operation is complete.

Returns

An IAsyncResult that references the asynchronous operation to add a new rule to the subscription.

OnClose(TimeSpan) OnClose(TimeSpan)

Executes the close action.

protected override void OnClose(TimeSpan timeout)Protected Overrides Sub OnClose(timeout As TimeSpan)
Parameters
timeout
TimeSpan TimeSpan

The wait time before the operation times out.

Overrides

OnEndAcceptMessageSession(IAsyncResult) OnEndAcceptMessageSession(IAsyncResult)

Executes upon calling the EndAcceptMessageSession operation.

protected abstract MessageSession OnEndAcceptMessageSession(IAsyncResult result)Protected MustOverride Function OnEndAcceptMessageSession(result As IAsyncResult) As MessageSession
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult that represents the status of the asynchronous accept message session operation.

Returns

The MessageSession that allows grouping of related messages for processing in a single transaction.

OnEndAddRule(IAsyncResult) OnEndAddRule(IAsyncResult)

Ends the asynchronous call to OnBeginAddRule(RuleDescription, TimeSpan, AsyncCallback, Object).

protected abstract void OnEndAddRule(IAsyncResult result)Protected MustOverride Sub OnEndAddRule(result As IAsyncResult)
Parameters

OnEndClose(IAsyncResult) OnEndClose(IAsyncResult)

Executes the end close action.

protected override void OnEndClose(IAsyncResult result)Protected Overrides Sub OnEndClose(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult that references the asynchronous BeginClose.

Overrides

OnEndCreateReceiver(IAsyncResult) OnEndCreateReceiver(IAsyncResult)

Executes the end create receiver action.

protected abstract MessageReceiver OnEndCreateReceiver(IAsyncResult result)Protected MustOverride Function OnEndCreateReceiver(result As IAsyncResult) As MessageReceiver
Parameters
result
IAsyncResult IAsyncResult

An IAsyncResult object that references the Microsoft.ServiceBus.Messaging.SubscriptionClient.EndCreateReceiver(System.IAsyncResult).

Returns

OnEndGetMessageSessions(IAsyncResult) OnEndGetMessageSessions(IAsyncResult)

Executes the end get message action.

protected abstract IEnumerable<MessageSession> OnEndGetMessageSessions(IAsyncResult result)Protected MustOverride Function OnEndGetMessageSessions(result As IAsyncResult) As IEnumerable(Of MessageSession)
Parameters
result
IAsyncResult IAsyncResult

The result of the message.

Returns

The end get message action.

OnEndRemoveRule(IAsyncResult) OnEndRemoveRule(IAsyncResult)

Ends the asynchronous call to OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object).

protected abstract void OnEndRemoveRule(IAsyncResult result)Protected MustOverride Sub OnEndRemoveRule(result As IAsyncResult)
Parameters

OnEndRemoveRules(IAsyncResult) OnEndRemoveRules(IAsyncResult)

Ends the asynchronous call to OnBeginRemoveRule(String, TimeSpan, AsyncCallback, Object).

protected abstract void OnEndRemoveRules(IAsyncResult result)Protected MustOverride Sub OnEndRemoveRules(result As IAsyncResult)
Parameters
result
IAsyncResult IAsyncResult

The result of the asynchronization.

OnMessage(Action<BrokeredMessage>) OnMessage(Action(Of BrokeredMessage))

Processes a message in an event-driven message pump.

public void OnMessage(Action<BrokeredMessage> callback)Public Sub OnMessage(callback As Action(Of BrokeredMessage))
Parameters
callback
Action<BrokeredMessage> Action(Of BrokeredMessage)

The method to invoke when the operation is complete.

OnMessage(Action<BrokeredMessage>, OnMessageOptions) OnMessage(Action(Of BrokeredMessage), OnMessageOptions)

Processes a message in an event-driven message pump, with the given set of OnMessageOptions options.

public void OnMessage(Action<BrokeredMessage> callback, OnMessageOptions onMessageOptions)Public Sub OnMessage(callback As Action(Of BrokeredMessage), onMessageOptions As OnMessageOptions)
Parameters
callback
Action<BrokeredMessage> Action(Of BrokeredMessage)

The method to invoke when the operation is complete.

onMessageOptions
OnMessageOptions OnMessageOptions

Specifies the OnMessageOptions options with which to instantiate the message pump.

OnMessageAsync(Func<BrokeredMessage, Task>) OnMessageAsync(Func(Of BrokeredMessage, Task))

Asynchronously processes a message.

public void OnMessageAsync(Func<BrokeredMessage, Task> callback)Public Sub OnMessageAsync(callback As Func(Of BrokeredMessage, Task))
Parameters
callback
Func<BrokeredMessage, Task> Func(Of BrokeredMessage, Task)

The asynchronous method to invoke when the operation is complete.

OnMessageAsync(Func<BrokeredMessage, Task>, OnMessageOptions) OnMessageAsync(Func(Of BrokeredMessage, Task), OnMessageOptions)

Asynchronously processes a message.

public void OnMessageAsync(Func<BrokeredMessage, Task> callback, OnMessageOptions onMessageOptions)Public Sub OnMessageAsync(callback As Func(Of BrokeredMessage, Task), onMessageOptions As OnMessageOptions)
Parameters
callback
Func<BrokeredMessage, Task> Func(Of BrokeredMessage, Task)

The asynchronous method to invoke when the operation is complete.

onMessageOptions
OnMessageOptions OnMessageOptions

The options associated with the message.

Peek() Peek()

Returns without removing the first message in the queue.

public BrokeredMessage Peek()Public Function Peek As BrokeredMessage
Returns

The returned message.

Remarks

A Null can be return by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

Peek(Int64) Peek(Int64)

Returns without removing the first message in the queue.

public BrokeredMessage Peek(long fromSequenceNumber)Public Function Peek(fromSequenceNumber As Long) As BrokeredMessage
Parameters
fromSequenceNumber
Int64 Int64

The starting point from which to browse a message.

Returns

The returned message.

Remarks

A Null can be return by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

PeekAsync() PeekAsync()

Asynchronously returns without removing the first message in the queue.

public Task<BrokeredMessage> PeekAsync()Public Function PeekAsync As Task(Of BrokeredMessage)
Returns

A task instance that represents the asynchronous peek operation.

PeekAsync(Int64) PeekAsync(Int64)

Asynchronously returns without removing the first message in the queue.

public Task<BrokeredMessage> PeekAsync(long fromSequenceNumber)Public Function PeekAsync(fromSequenceNumber As Long) As Task(Of BrokeredMessage)
Parameters
fromSequenceNumber
Int64 Int64

The starting point from which to browse a message.

Returns

A task instance that represents the asynchronous peek operation.

PeekBatch(Int32) PeekBatch(Int32)

Returns without removing the first messages in a batch.

public IEnumerable<BrokeredMessage> PeekBatch(int messageCount)Public Function PeekBatch(messageCount As Integer) As IEnumerable(Of BrokeredMessage)
Parameters
messageCount
Int32 Int32

The number of messages in a batch.

Returns

The collection of first messages in a batch.

Remarks

A Null can be return by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

PeekBatch(Int64, Int32) PeekBatch(Int64, Int32)

Returns without removing the first messages in a batch.

public IEnumerable<BrokeredMessage> PeekBatch(long fromSequenceNumber, int messageCount)Public Function PeekBatch(fromSequenceNumber As Long, messageCount As Integer) As IEnumerable(Of BrokeredMessage)
Parameters
fromSequenceNumber
Int64 Int64

The starting point from which to browse a message.

messageCount
Int32 Int32

The number of messages in a batch.

Returns

The collection of first messages in a batch.

PeekBatchAsync(Int32) PeekBatchAsync(Int32)

Asynchronously returns without removing the first messages in a batch.

public Task<IEnumerable<BrokeredMessage>> PeekBatchAsync(int messageCount)Public Function PeekBatchAsync(messageCount As Integer) As Task(Of IEnumerable(Of BrokeredMessage))
Parameters
messageCount
Int32 Int32

The number of messages in a batch.

Returns

A task instance that represents the asynchronous peek batch operation.

PeekBatchAsync(Int64, Int32) PeekBatchAsync(Int64, Int32)

Asynchronously returns without removing the first messages in a batch.

public Task<IEnumerable<BrokeredMessage>> PeekBatchAsync(long fromSequenceNumber, int messageCount)Public Function PeekBatchAsync(fromSequenceNumber As Long, messageCount As Integer) As Task(Of IEnumerable(Of BrokeredMessage))
Parameters
fromSequenceNumber
Int64 Int64

The starting point from which to browse a message.

messageCount
Int32 Int32

The number of messages in a batch.

Returns

A task instance that represents the asynchronous peek batch operation.

Receive() Receive()

Receives a message using the Microsoft.ServiceBus.Messaging.QueueClient.InternalReceiver.

public BrokeredMessage Receive()Public Function Receive As BrokeredMessage
Returns

The BrokeredMessage that represents the received message.

Exceptions

Thrown when the subscription does not exist.

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

Thrown if the client entity has been closed or aborted.

Thrown if there is an authentication error.

Remarks

A Null can be return by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

Receive(Int64) Receive(Int64)

Receives a message using the Microsoft.ServiceBus.Messaging.QueueClient.InternalReceiver.

public BrokeredMessage Receive(long sequenceNumber)Public Function Receive(sequenceNumber As Long) As BrokeredMessage
Parameters
sequenceNumber
Int64 Int64

The sequence number of the deferred message to receive.

Returns

The BrokeredMessage that represents the received message.

Exceptions

Thrown if the client entity has been closed or aborted.

Remarks

A Null can be return by this API if operation exceeded the timeout specified, or the operations succeeded but the message with the requested sequenceNumber cannot be located.

Receive(TimeSpan) Receive(TimeSpan)

Receives a message using the Microsoft.ServiceBus.Messaging.QueueClient.InternalReceiver.

public BrokeredMessage Receive(TimeSpan serverWaitTime)Public Function Receive(serverWaitTime As TimeSpan) As BrokeredMessage
Parameters
serverWaitTime
TimeSpan TimeSpan

The time span the server waits for receiving a message before it times out.

Returns

The BrokeredMessage that represents the received message.

Exceptions

Thrown if the serverWaitTime is negative.

Thrown when the subscription does not exist.

Thrown if the client entity has been closed or aborted.

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

Thrown if there is an authentication error.

Remarks

A Null can be return by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

ReceiveAsync() ReceiveAsync()

Asynchronously receives a message using the Microsoft.ServiceBus.Messaging.QueueClient.InternalReceiver.

public Task<BrokeredMessage> ReceiveAsync()Public Function ReceiveAsync As Task(Of BrokeredMessage)
Returns

A task instance that represents the asynchronous receive operation.

ReceiveAsync(Int64) ReceiveAsync(Int64)

Asynchronously receives a message using the Microsoft.ServiceBus.Messaging.QueueClient.InternalReceiver.

public Task<BrokeredMessage> ReceiveAsync(long sequenceNumber)Public Function ReceiveAsync(sequenceNumber As Long) As Task(Of BrokeredMessage)
Parameters
sequenceNumber
Int64 Int64

The sequence number of the deferred message to receive.

Returns

A task instance that represents the asynchronous receive operation.

ReceiveAsync(TimeSpan) ReceiveAsync(TimeSpan)

Asynchronously receives a message using the Microsoft.ServiceBus.Messaging.QueueClient.InternalReceiver.

public Task<BrokeredMessage> ReceiveAsync(TimeSpan serverWaitTime)Public Function ReceiveAsync(serverWaitTime As TimeSpan) As Task(Of BrokeredMessage)
Parameters
serverWaitTime
TimeSpan TimeSpan

The time span the server waits for receiving a message before it times out.

Returns

A task instance that represents the asynchronous receive operation.

ReceiveBatch(IEnumerable<Int64>) ReceiveBatch(IEnumerable(Of Int64))

Receives a batch after the asynchronous operation.

public IEnumerable<BrokeredMessage> ReceiveBatch(IEnumerable<long> sequenceNumbers)Public Function ReceiveBatch(sequenceNumbers As IEnumerable(Of Long)) As IEnumerable(Of BrokeredMessage)
Parameters
sequenceNumbers
IEnumerable<Int64> IEnumerable(Of Int64)

The sequence number.

Returns

A batch after the asynchronous operation.

Remarks

A Null can be return by this API if operation exceeded the timeout specified, or the operations succeeded but the message with the requested sequenceNumber cannot be located.

ReceiveBatch(Int32) ReceiveBatch(Int32)

Receives a batch after the asynchronous operation.

public IEnumerable<BrokeredMessage> ReceiveBatch(int messageCount)Public Function ReceiveBatch(messageCount As Integer) As IEnumerable(Of BrokeredMessage)
Parameters
messageCount
Int32 Int32

The number of messages to return in the batch. As this is an approximation, fewer or more messages than messageCount may be returned.

Returns

A batch after the asynchronous operation.

Remarks

A Null can be return by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

ReceiveBatch(Int32, TimeSpan) ReceiveBatch(Int32, TimeSpan)

Receives a batch after the asynchronous operation.

public IEnumerable<BrokeredMessage> ReceiveBatch(int messageCount, TimeSpan serverWaitTime)Public Function ReceiveBatch(messageCount As Integer, serverWaitTime As TimeSpan) As IEnumerable(Of BrokeredMessage)
Parameters
messageCount
Int32 Int32

The number of messages to return in the batch. As this is an approximation, fewer or more messages than messageCount may be returned.

serverWaitTime
TimeSpan TimeSpan

The time span the server waits for processing messages.

Returns

A batch after the asynchronous operation.

Remarks

A Null can be return by this API if operation exceeded the timeout specified, or the operations succeeded but there are no more messages to be received.

ReceiveBatchAsync(IEnumerable<Int64>) ReceiveBatchAsync(IEnumerable(Of Int64))

Asynchronously receives a set of messages (for batch processing).

public Task<IEnumerable<BrokeredMessage>> ReceiveBatchAsync(IEnumerable<long> sequenceNumbers)Public Function ReceiveBatchAsync(sequenceNumbers As IEnumerable(Of Long)) As Task(Of IEnumerable(Of BrokeredMessage))
Parameters
sequenceNumbers
IEnumerable<Int64> IEnumerable(Of Int64)

The sequence number.

Returns

A task instance that represents the asynchronous receive batch operation.

ReceiveBatchAsync(Int32) ReceiveBatchAsync(Int32)

Asynchronously receives a set of messages (for batch processing).

public Task<IEnumerable<BrokeredMessage>> ReceiveBatchAsync(int messageCount)Public Function ReceiveBatchAsync(messageCount As Integer) As Task(Of IEnumerable(Of BrokeredMessage))
Parameters
messageCount
Int32 Int32

The number of messages to return in the batch. As this is an approximation, fewer or more messages than messageCount may be returned.

Returns

A task instance that represents the asynchronous receive batch operation.

ReceiveBatchAsync(Int32, TimeSpan) ReceiveBatchAsync(Int32, TimeSpan)

Asynchronously receives a set of messages (for batch processing).

public Task<IEnumerable<BrokeredMessage>> ReceiveBatchAsync(int messageCount, TimeSpan serverWaitTime)Public Function ReceiveBatchAsync(messageCount As Integer, serverWaitTime As TimeSpan) As Task(Of IEnumerable(Of BrokeredMessage))
Parameters
messageCount
Int32 Int32

The number of messages to return in the batch. As this is an approximation, fewer or more messages than messageCount may be returned.

serverWaitTime
TimeSpan TimeSpan

The time span the server waits for processing messages.

Returns

A task instance that represents the asynchronous receive batch operation.

RegisterSessionHandler(Type) RegisterSessionHandler(Type)

Registers the handler for the client session.

public void RegisterSessionHandler(Type handlerType)Public Sub RegisterSessionHandler(handlerType As Type)
Parameters
handlerType
Type Type

The type of the handler.

RegisterSessionHandler(Type, SessionHandlerOptions) RegisterSessionHandler(Type, SessionHandlerOptions)

Registers the handler for the client session.

public void RegisterSessionHandler(Type handlerType, SessionHandlerOptions options)Public Sub RegisterSessionHandler(handlerType As Type, options As SessionHandlerOptions)
Parameters
handlerType
Type Type

The type of the handler.

options
SessionHandlerOptions SessionHandlerOptions

The session handler options.

RegisterSessionHandlerAsync(Type) RegisterSessionHandlerAsync(Type)

Asynchronously registers the handler for the client session.

public Task RegisterSessionHandlerAsync(Type handlerType)Public Function RegisterSessionHandlerAsync(handlerType As Type) As Task
Parameters
handlerType
Type Type

The type of the handler.

Returns

The task object representing the asynchronous operation.

RegisterSessionHandlerAsync(Type, SessionHandlerOptions) RegisterSessionHandlerAsync(Type, SessionHandlerOptions)

Asynchronously registers the handler for the client session.

public Task RegisterSessionHandlerAsync(Type handlerType, SessionHandlerOptions options)Public Function RegisterSessionHandlerAsync(handlerType As Type, options As SessionHandlerOptions) As Task
Parameters
handlerType
Type Type

The type of the handler.

options
SessionHandlerOptions SessionHandlerOptions

The session handler options.

Returns

The task object representing the asynchronous operation.

RegisterSessionHandlerFactory(IMessageSessionAsyncHandlerFactory, SessionHandlerOptions) RegisterSessionHandlerFactory(IMessageSessionAsyncHandlerFactory, SessionHandlerOptions)

Registers the handler factory for the client session.

public void RegisterSessionHandlerFactory(IMessageSessionAsyncHandlerFactory factory, SessionHandlerOptions options)Public Sub RegisterSessionHandlerFactory(factory As IMessageSessionAsyncHandlerFactory, options As SessionHandlerOptions)
Parameters
factory
IMessageSessionAsyncHandlerFactory IMessageSessionAsyncHandlerFactory

The interface for the handler factory associated with the message session.

options
SessionHandlerOptions SessionHandlerOptions

The session handler options.

RegisterSessionHandlerFactory(IMessageSessionHandlerFactory, SessionHandlerOptions) RegisterSessionHandlerFactory(IMessageSessionHandlerFactory, SessionHandlerOptions)

Registers the handler factory for the client session.

public void RegisterSessionHandlerFactory(IMessageSessionHandlerFactory factory, SessionHandlerOptions options)Public Sub RegisterSessionHandlerFactory(factory As IMessageSessionHandlerFactory, options As SessionHandlerOptions)
Parameters
factory
IMessageSessionHandlerFactory IMessageSessionHandlerFactory

The interface for the handler factory associated with the message session.

options
SessionHandlerOptions SessionHandlerOptions

The session handler options.

RegisterSessionHandlerFactoryAsync(IMessageSessionAsyncHandlerFactory, SessionHandlerOptions) RegisterSessionHandlerFactoryAsync(IMessageSessionAsyncHandlerFactory, SessionHandlerOptions)

Asynchronously registers the handler factory for the client session.

public Task RegisterSessionHandlerFactoryAsync(IMessageSessionAsyncHandlerFactory factory, SessionHandlerOptions options)Public Function RegisterSessionHandlerFactoryAsync(factory As IMessageSessionAsyncHandlerFactory, options As SessionHandlerOptions) As Task
Parameters
factory
IMessageSessionAsyncHandlerFactory IMessageSessionAsyncHandlerFactory

The interface for the handler factory associated with the message session.

options
SessionHandlerOptions SessionHandlerOptions

The session handler options.

Returns

The task object representing the asynchronous operation.

RegisterSessionHandlerFactoryAsync(IMessageSessionHandlerFactory, SessionHandlerOptions) RegisterSessionHandlerFactoryAsync(IMessageSessionHandlerFactory, SessionHandlerOptions)

Asynchronously registers the handler factory for the client session.

public Task RegisterSessionHandlerFactoryAsync(IMessageSessionHandlerFactory factory, SessionHandlerOptions options)Public Function RegisterSessionHandlerFactoryAsync(factory As IMessageSessionHandlerFactory, options As SessionHandlerOptions) As Task
Parameters
factory
IMessageSessionHandlerFactory IMessageSessionHandlerFactory

The interface for the handler factory associated with the message session.

options
SessionHandlerOptions SessionHandlerOptions

The session handler options.

Returns

The task object representing the asynchronous operation.

RemoveRule(String) RemoveRule(String)

Removes the rule described by ruleName.

public void RemoveRule(string ruleName)Public Sub RemoveRule(ruleName As String)
Parameters
ruleName
String String

The name of the rule.

Exceptions

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

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

Thrown if the client entity has been closed or aborted.

RemoveRuleAsync(String) RemoveRuleAsync(String)

Asynchronously removes the rule described by ruleName.

public Task RemoveRuleAsync(string ruleName)Public Function RemoveRuleAsync(ruleName As String) As Task
Parameters
ruleName
String String

The name of the rule.

Returns

A task instance that represents the asynchronous remove rule operation.

RenewMessageLock(Guid) RenewMessageLock(Guid)

public DateTime RenewMessageLock(Guid lockToken)Public Function RenewMessageLock(lockToken As Guid) As Date
Parameters
lockToken
Guid Guid
Returns

RenewMessageLockAsync(Guid) RenewMessageLockAsync(Guid)

public Task<DateTime> RenewMessageLockAsync(Guid lockToken)Public Function RenewMessageLockAsync(lockToken As Guid) As Task(Of Date)
Parameters
lockToken
Guid Guid
Returns