MessagingFactory MessagingFactory Class

Definition

The MessagingFactory class is the anchor class used for run time operations to send and receive to and from queues, topics, or subscriptions.

public abstract class MessagingFactory : ClientEntity, IMessageClientEntity, ICloseablePublic MustInherit Class MessagingFactory
    Inherits ClientEntity
    Implements IMessageClientEntity, ICloseable
Inheritance
MessagingFactoryMessagingFactory

Inherited Members

Microsoft.ServiceBus.Messaging.ClientEntity

System.Object

Examples

string Address = "sb://myapp.WindowsAzure.com/"; //base address of namespace you are connecting to.
MessagingFactorySettings MsgFactorySettings = new MessagingFactorySettings(); //specify operating timeout (optional)
MessagingFactory MsgFactory = MessagingFactory.Create(Address, MsgFactorySettings);

Remarks

Please note that any member method with CreateXXXClient, such as CreateQueueClient, does not create a new entity in the namespace. It only gets handle to an existing entity created earlier using the NamespaceManager. If these entities does not exist in the namespace, you will get an exception.

Properties

Address Address

Gets the base address of the messaging factory.

public Uri Address { get; }Public ReadOnly Property Address As Uri
Value
Uri Uri

A URI that represents the base address of the messaging factory.

NamespaceEndpoints NamespaceEndpoints

Gets a list of namespace endpoints.

public IEnumerable<Uri> NamespaceEndpoints { get; }Public ReadOnly Property NamespaceEndpoints As IEnumerable(Of Uri)
Value
IEnumerable<Uri> IEnumerable(Of Uri)

A list of namespace endpoints.

PrefetchCount PrefetchCount

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

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

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

Remarks

Takes effect on the next acceptmessagesession call to the server

Methods

AcceptMessageSession() AcceptMessageSession()

Returns available sessions across all session-enabled subscriptions and queues in the service namespace.

public MessageSession AcceptMessageSession()Public Function AcceptMessageSession As MessageSession
Returns

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

AcceptMessageSession(TimeSpan) AcceptMessageSession(TimeSpan)

Returns available sessions across all session-enabled subscriptions and queues in the service namespace.

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

The processing time out.

Returns

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

AcceptMessageSessionAsync() AcceptMessageSessionAsync()

Asynchronously returns available sessions across all session-enabled subscriptions and queues in the service namespace.

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

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

AcceptMessageSessionAsync(TimeSpan) AcceptMessageSessionAsync(TimeSpan)

Asynchronously returns available sessions across all session-enabled subscriptions and queues in the service namespace.

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

The processing time out.

Returns

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

Create() Create()

Creates a new messaging factory object.

public static MessagingFactory Create()Public Shared Function Create As MessagingFactory
Returns

Create(IEnumerable<String>) Create(IEnumerable(Of String))

Creates a new MessagingFactory object.

public static MessagingFactory Create(IEnumerable<string> addresses)Public Shared Function Create(addresses As IEnumerable(Of String)) As MessagingFactory
Parameters
addresses
IEnumerable<String> IEnumerable(Of String)

An enumeration of base addresses.

Returns

Create(IEnumerable<String>, MessagingFactorySettings) Create(IEnumerable(Of String), MessagingFactorySettings)

Creates a new MessagingFactory object.

public static MessagingFactory Create(IEnumerable<string> addresses, MessagingFactorySettings factorySettings)Public Shared Function Create(addresses As IEnumerable(Of String), factorySettings As MessagingFactorySettings) As MessagingFactory
Parameters
addresses
IEnumerable<String> IEnumerable(Of String)

An enumeration of base addresses.

factorySettings
MessagingFactorySettings MessagingFactorySettings

The factory settings.

Returns

Create(IEnumerable<String>, TokenProvider) Create(IEnumerable(Of String), TokenProvider)

Creates a new MessagingFactory object.

public static MessagingFactory Create(IEnumerable<string> addresses, TokenProvider tokenProvider)Public Shared Function Create(addresses As IEnumerable(Of String), tokenProvider As TokenProvider) As MessagingFactory
Parameters
addresses
IEnumerable<String> IEnumerable(Of String)

An enumeration of base addresses.

tokenProvider
TokenProvider TokenProvider

The token provider.

Returns

Create(IEnumerable<Uri>) Create(IEnumerable(Of Uri))

Creates a new MessagingFactory object.

public static MessagingFactory Create(IEnumerable<Uri> addresses)Public Shared Function Create(addresses As IEnumerable(Of Uri)) As MessagingFactory
Parameters
addresses
IEnumerable<Uri> IEnumerable(Of Uri)

An enumeration of address.

Returns

Create(IEnumerable<Uri>, MessagingFactorySettings) Create(IEnumerable(Of Uri), MessagingFactorySettings)

Creates a new MessagingFactory object.

public static MessagingFactory Create(IEnumerable<Uri> addresses, MessagingFactorySettings factorySettings)Public Shared Function Create(addresses As IEnumerable(Of Uri), factorySettings As MessagingFactorySettings) As MessagingFactory
Parameters
addresses
IEnumerable<Uri> IEnumerable(Of Uri)

An enumeration of address.

factorySettings
MessagingFactorySettings MessagingFactorySettings

The factory settings.

Returns

Create(IEnumerable<Uri>, TokenProvider) Create(IEnumerable(Of Uri), TokenProvider)

Creates a new MessagingFactory object.

public static MessagingFactory Create(IEnumerable<Uri> addresses, TokenProvider tokenProvider)Public Shared Function Create(addresses As IEnumerable(Of Uri), tokenProvider As TokenProvider) As MessagingFactory
Parameters
addresses
IEnumerable<Uri> IEnumerable(Of Uri)

An enumeration of address.

tokenProvider
TokenProvider TokenProvider

The token provider.

Returns

Create(String) Create(String)

Creates a new MessagingFactory object.

public static MessagingFactory Create(string address)Public Shared Function Create(address As String) As MessagingFactory
Parameters
address
String String

The base address of the service namespace.

Returns

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

Creates a new MessagingFactory object.

public static MessagingFactory Create(string address, MessagingFactorySettings factorySettings)Public Shared Function Create(address As String, factorySettings As MessagingFactorySettings) As MessagingFactory
Parameters
address
String String

The base address of the service namespace.

Returns
Exceptions

Thrown when address is empty.

Thrown when factorySettings or address are null.

address contains a path appended to the full address of the service namespace.

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

Creates a new MessagingFactory object.

public static MessagingFactory Create(string address, TokenProvider tokenProvider)Public Shared Function Create(address As String, tokenProvider As TokenProvider) As MessagingFactory
Parameters
address
String String

The base address of the namespace.

tokenProvider
TokenProvider TokenProvider

The token provider.

Returns
Exceptions

address contains a path appended to the full address of the service namespace.

Thrown when address is empty.

Thrown when tokenProvider or address are null.

Create(Uri) Create(Uri)

Creates a new MessagingFactory object.

public static MessagingFactory Create(Uri address)Public Shared Function Create(address As Uri) As MessagingFactory
Parameters
address
Uri Uri

The namespace base address.

Returns

Create(Uri, MessagingFactorySettings) Create(Uri, MessagingFactorySettings)

Creates a new MessagingFactory object.

public static MessagingFactory Create(Uri address, MessagingFactorySettings factorySettings)Public Shared Function Create(address As Uri, factorySettings As MessagingFactorySettings) As MessagingFactory
Parameters
address
Uri Uri

The namespace base address.

Returns
Exceptions

Thrown when address or factorySettings is null.

address contains a path appended to the full address of the service namespace.

Create(Uri, TokenProvider) Create(Uri, TokenProvider)

Creates a new MessagingFactory object.

public static MessagingFactory Create(Uri address, TokenProvider tokenProvider)Public Shared Function Create(address As Uri, tokenProvider As TokenProvider) As MessagingFactory
Parameters
address
Uri Uri

The base address of the namespace.

tokenProvider
TokenProvider TokenProvider

The token provider.

Returns
Exceptions

address contains a path appended to the full address of the service namespace.

Thrown when tokenProvider or address are null.

CreateAsync(IEnumerable<String>) CreateAsync(IEnumerable(Of String))

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(IEnumerable<string> addresses)Public Shared Function CreateAsync(addresses As IEnumerable(Of String)) As Task(Of MessagingFactory)
Parameters
addresses
IEnumerable<String> IEnumerable(Of String)

An enumeration of base addresses.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(IEnumerable<String>, MessagingFactorySettings) CreateAsync(IEnumerable(Of String), MessagingFactorySettings)

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(IEnumerable<string> addresses, MessagingFactorySettings factorySettings)Public Shared Function CreateAsync(addresses As IEnumerable(Of String), factorySettings As MessagingFactorySettings) As Task(Of MessagingFactory)
Parameters
addresses
IEnumerable<String> IEnumerable(Of String)

An enumeration of base addresses.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(IEnumerable<String>, TokenProvider) CreateAsync(IEnumerable(Of String), TokenProvider)

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(IEnumerable<string> addresses, TokenProvider tokenProvider)Public Shared Function CreateAsync(addresses As IEnumerable(Of String), tokenProvider As TokenProvider) As Task(Of MessagingFactory)
Parameters
addresses
IEnumerable<String> IEnumerable(Of String)

An enumeration of base addresses.

tokenProvider
TokenProvider TokenProvider

The token provider.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(IEnumerable<Uri>) CreateAsync(IEnumerable(Of Uri))

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(IEnumerable<Uri> addresses)Public Shared Function CreateAsync(addresses As IEnumerable(Of Uri)) As Task(Of MessagingFactory)
Parameters
addresses
IEnumerable<Uri> IEnumerable(Of Uri)

An enumeration of address.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(IEnumerable<Uri>, MessagingFactorySettings) CreateAsync(IEnumerable(Of Uri), MessagingFactorySettings)

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(IEnumerable<Uri> addresses, MessagingFactorySettings factorySettings)Public Shared Function CreateAsync(addresses As IEnumerable(Of Uri), factorySettings As MessagingFactorySettings) As Task(Of MessagingFactory)
Parameters
addresses
IEnumerable<Uri> IEnumerable(Of Uri)

An enumeration of address.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(IEnumerable<Uri>, TokenProvider) CreateAsync(IEnumerable(Of Uri), TokenProvider)

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(IEnumerable<Uri> addresses, TokenProvider tokenProvider)Public Shared Function CreateAsync(addresses As IEnumerable(Of Uri), tokenProvider As TokenProvider) As Task(Of MessagingFactory)
Parameters
addresses
IEnumerable<Uri> IEnumerable(Of Uri)

An enumeration of address.

tokenProvider
TokenProvider TokenProvider

The token provider.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(String) CreateAsync(String)

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(string address)Public Shared Function CreateAsync(address As String) As Task(Of MessagingFactory)
Parameters
address
String String

The base address of the service namespace.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(String, MessagingFactorySettings) CreateAsync(String, MessagingFactorySettings)

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(string address, MessagingFactorySettings factorySettings)Public Shared Function CreateAsync(address As String, factorySettings As MessagingFactorySettings) As Task(Of MessagingFactory)
Parameters
address
String String

The base address of the service namespace.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(String, TokenProvider) CreateAsync(String, TokenProvider)

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(string address, TokenProvider tokenProvider)Public Shared Function CreateAsync(address As String, tokenProvider As TokenProvider) As Task(Of MessagingFactory)
Parameters
address
String String

The base address of the service namespace.

tokenProvider
TokenProvider TokenProvider

The token provider.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(Uri) CreateAsync(Uri)

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(Uri address)Public Shared Function CreateAsync(address As Uri) As Task(Of MessagingFactory)
Parameters
address
Uri Uri

The namespace base address.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(Uri, MessagingFactorySettings) CreateAsync(Uri, MessagingFactorySettings)

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(Uri address, MessagingFactorySettings factorySettings)Public Shared Function CreateAsync(address As Uri, factorySettings As MessagingFactorySettings) As Task(Of MessagingFactory)
Parameters
address
Uri Uri

The namespace base address.

Returns

A task instance that represents the asynchronous create operation.

CreateAsync(Uri, TokenProvider) CreateAsync(Uri, TokenProvider)

Asynchronously creates a new messaging factory object.

public static Task<MessagingFactory> CreateAsync(Uri address, TokenProvider tokenProvider)Public Shared Function CreateAsync(address As Uri, tokenProvider As TokenProvider) As Task(Of MessagingFactory)
Parameters
address
Uri Uri

The namespace base address.

tokenProvider
TokenProvider TokenProvider

The token provider.

Returns

A task instance that represents the asynchronous create operation.

CreateEventHubClient(String) CreateEventHubClient(String)

Creates a new EventHubClient object using the specified path.

public EventHubClient CreateEventHubClient(string path)Public Function CreateEventHubClient(path As String) As EventHubClient
Parameters
path
String String

The path to the Event Hub.

Returns

The newly created EventHubClient object.

Exceptions

CreateFromConnectionString(String) CreateFromConnectionString(String)

Creates a new MessagingFactory object from a connection string.

public static MessagingFactory CreateFromConnectionString(string connectionString)Public Shared Function CreateFromConnectionString(connectionString As String) As MessagingFactory
Parameters
connectionString
String String

The connection string.

Returns

CreateMessageReceiver(String) CreateMessageReceiver(String)

Creates a message receiver.

public MessageReceiver CreateMessageReceiver(string entityPath)Public Function CreateMessageReceiver(entityPath As String) As MessageReceiver
Parameters
entityPath
String String

The path of the entity.

Returns

The newly created message receiver.

CreateMessageReceiver(String, ReceiveMode) CreateMessageReceiver(String, ReceiveMode)

Creates a message receiver.

public MessageReceiver CreateMessageReceiver(string entityPath, ReceiveMode receiveMode)Public Function CreateMessageReceiver(entityPath As String, receiveMode As ReceiveMode) As MessageReceiver
Parameters
entityPath
String String

The path of the entity.

receiveMode
ReceiveMode ReceiveMode

The receive mode.

Returns

The newly created message receiver.

CreateMessageReceiverAsync(String) CreateMessageReceiverAsync(String)

Asynchronously creates a message receiver.

public Task<MessageReceiver> CreateMessageReceiverAsync(string entityPath)Public Function CreateMessageReceiverAsync(entityPath As String) As Task(Of MessageReceiver)
Parameters
entityPath
String String

The path of the entity.

Returns

A task instance that represents the asynchronous create message receiver operation.

CreateMessageReceiverAsync(String, ReceiveMode) CreateMessageReceiverAsync(String, ReceiveMode)

Asynchronously creates a message receiver.

public Task<MessageReceiver> CreateMessageReceiverAsync(string entityPath, ReceiveMode receiveMode)Public Function CreateMessageReceiverAsync(entityPath As String, receiveMode As ReceiveMode) As Task(Of MessageReceiver)
Parameters
entityPath
String String

The path of the entity.

receiveMode
ReceiveMode ReceiveMode

The receive mode.

Returns

A task instance that represents the asynchronous create message receiver operation.

CreateMessageSender(String) CreateMessageSender(String)

Creates a message sender.

public MessageSender CreateMessageSender(string entityPath)Public Function CreateMessageSender(entityPath As String) As MessageSender
Parameters
entityPath
String String

The path of the entity.

Returns

The newly created message sender.

CreateMessageSender(String, String) CreateMessageSender(String, String)

Creates a message sender.

public MessageSender CreateMessageSender(string transferDestinationEntityPath, string viaEntityPath)Public Function CreateMessageSender(transferDestinationEntityPath As String, viaEntityPath As String) As MessageSender
Parameters
transferDestinationEntityPath
String String

The transfer destination entity path.

viaEntityPath
String String

The via-entity path.

Returns

CreateMessageSenderAsync(String) CreateMessageSenderAsync(String)

Asynchronously creates a message sender.

public Task<MessageSender> CreateMessageSenderAsync(string entityPath)Public Function CreateMessageSenderAsync(entityPath As String) As Task(Of MessageSender)
Parameters
entityPath
String String

The path of the entity.

Returns

A task instance that represents the asynchronous create message sender operation.

CreateMessageSenderAsync(String, String) CreateMessageSenderAsync(String, String)

Asynchronously creates a message sender.

public Task<MessageSender> CreateMessageSenderAsync(string transferDestinationEntityPath, string viaEntityPath)Public Function CreateMessageSenderAsync(transferDestinationEntityPath As String, viaEntityPath As String) As Task(Of MessageSender)
Parameters
transferDestinationEntityPath
String String

The transfer destination entity path.

viaEntityPath
String String

The via-entity path.

Returns

A task instance that represents the asynchronous create message sender operation.

CreateQueueClient(String) CreateQueueClient(String)

Creates a new queue client.

public QueueClient CreateQueueClient(string path)Public Function CreateQueueClient(path As String) As QueueClient
Parameters
path
String String

The path of the queue relative to the service namespace base address.

Returns

The newly created queue client.

Exceptions

path is null or empty.

path length is greater than Microsoft.ServiceBus.Messaging.Constants.TopicNameMaximumLength.

The operation times out. The timeout period is initialized through the MessagingFactorySettings object. You may need to increase the value of OperationTimeout to avoid this exception if the timeout value is relatively low.

An internal error or unexpected exception occurs.

The factory has been closed or aborted.

CreateQueueClient(String, ReceiveMode) CreateQueueClient(String, ReceiveMode)

Creates a new queue client.

public QueueClient CreateQueueClient(string path, ReceiveMode receiveMode)Public Function CreateQueueClient(path As String, receiveMode As ReceiveMode) As QueueClient
Parameters
path
String String

The path of the queue relative to the service namespace base address.

receiveMode
ReceiveMode ReceiveMode

The receive mode.

Returns

The newly created queue client.

Exceptions

path is null or empty.

path length is greater than Microsoft.ServiceBus.Messaging.Constants.TopicNameMaximumLength.

The operation times out. The timeout period is initialized through the MessagingFactorySettings object. You may need to increase the value of OperationTimeout to avoid this exception if the timeout value is relatively low.

An internal error or unexpected exception occurs.

The factory has been closed or aborted.

CreateSubscriptionClient(String, String) CreateSubscriptionClient(String, String)

Creates a subscription client.

public SubscriptionClient CreateSubscriptionClient(string topicPath, string name)Public Function CreateSubscriptionClient(topicPath As String, name As String) As SubscriptionClient
Parameters
topicPath
String String

The topic path relative to the service namespace.

name
String String

The name of the subscription.

Returns

The newly created subscription client.

Exceptions

The supplied topicPath is null or empty.

The length of topicPath is greater than Microsoft.ServiceBus.Messaging.Constants.TopicNameMaximumLength.

The operation times out. The timeout period is initialized through the MessagingFactorySettings object. You may need to increase the value of OperationTimeout to avoid this exception if the timeout value is relatively low.

An internal error or unexpected exception occurs.

The factory has been closed or aborted.

CreateSubscriptionClient(String, String, ReceiveMode) CreateSubscriptionClient(String, String, ReceiveMode)

Creates a new subscription client.

public SubscriptionClient CreateSubscriptionClient(string topicPath, string name, ReceiveMode receiveMode)Public Function CreateSubscriptionClient(topicPath As String, name As String, receiveMode As ReceiveMode) As SubscriptionClient
Parameters
topicPath
String String

The topic path relative to the service namespace.

name
String String

The name of the subscription.

receiveMode
ReceiveMode ReceiveMode

The receive mode.

Returns

The newly created subscription client.

Exceptions

The supplied topicPath is null or empty.

The length of topicPath is greater than Microsoft.ServiceBus.Messaging.Constants.TopicNameMaximumLength.

The operation times out. The timeout period is initialized through the MessagingFactorySettings object. You may need to increase the value of OperationTimeout to avoid this exception if the timeout value is relatively low.

An internal error or unexpected exception occurs.

The factory has been closed or aborted.

CreateTopicClient(String) CreateTopicClient(String)

Creates a new topic client.

public TopicClient CreateTopicClient(string path)Public Function CreateTopicClient(path As String) As TopicClient
Parameters
path
String String

The topic path relative to the service namespace base address.

Returns

The newly created topic client.

Exceptions

The supplied path is null.

The operation times out. The timeout period is initialized through the MessagingFactorySettings object. You may need to increase the value of OperationTimeout to avoid this exception if the timeout value is relatively low.

An internal error or unexpected exception occurs.

The factory has been closed or aborted.

GetSettings() GetSettings()

Retrieves a copy of the settings of the messaging factory.

public MessagingFactorySettings GetSettings()Public Function GetSettings As MessagingFactorySettings
Returns

A copy of the messaging factory settings.

IncrementConnectionResetCount(Uri) IncrementConnectionResetCount(Uri)

protected void IncrementConnectionResetCount(Uri endpoint)Protected Sub IncrementConnectionResetCount(endpoint As Uri)
Parameters
endpoint
Uri Uri

OnAbort() OnAbort()

Executes the abort action.

protected override void OnAbort()Protected Overrides Sub OnAbort
Overrides

OnAcceptMessageSession(ReceiveMode, TimeSpan, TimeSpan) OnAcceptMessageSession(ReceiveMode, TimeSpan, TimeSpan)

Executes the accept message session.

protected virtual MessageSession OnAcceptMessageSession(ReceiveMode receiveMode, TimeSpan serverWaitTime, TimeSpan timeout)Protected Overridable Function OnAcceptMessageSession(receiveMode As ReceiveMode, serverWaitTime As TimeSpan, timeout As TimeSpan) As MessageSession
Parameters
receiveMode
ReceiveMode ReceiveMode

The message receive mode.

serverWaitTime
TimeSpan TimeSpan

The server wait time.

timeout
TimeSpan TimeSpan

The operation timeout.

Returns

The executed message session.

OnAcceptSessionReceiver(String, String, ReceiveMode, TimeSpan) OnAcceptSessionReceiver(String, String, ReceiveMode, TimeSpan)

Executes the accept session receiver action.

protected virtual MessageSession OnAcceptSessionReceiver(string entityName, string sessionId, ReceiveMode receiveMode, TimeSpan timeout)Protected Overridable Function OnAcceptSessionReceiver(entityName As String, sessionId As String, receiveMode As ReceiveMode, timeout As TimeSpan) As MessageSession
Parameters
entityName
String String

The name of the entity.

sessionId
String String

The session identifier.

receiveMode
ReceiveMode ReceiveMode

The message receive mode.

timeout
TimeSpan TimeSpan

The wait time before the operation times out.

Returns

An IAsyncResult object that references the asynchronous accept session receiver action.

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

Executes the begin accept message session action.

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

The receive mode.

serverWaitTime
TimeSpan TimeSpan

The server wait time.

timeout
TimeSpan TimeSpan

The operation timeout.

callback
AsyncCallback AsyncCallback

The asynchronous callback.

state
Object Object

The session state.

Returns

The asynchronous result of the operation.

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

Executes the begin accept session receiver action.

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

The name of the entity.

sessionId
String String

The session identifier.

receiveMode
ReceiveMode ReceiveMode

The message receive mode.

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.

Returns

An IAsyncResult object that references the asynchronous accept session receiver action.

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 timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns

An IAsyncResult object that references the asynchronous close action.

Overrides

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

Executes the begin create message receiver action.

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

The name of the entity.

receiveMode
ReceiveMode ReceiveMode

The message receive mode.

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.

Returns

An IAsyncResult object that references the asynchronous create message receiver action.

OnBeginCreateMessageSender(String, String, TimeSpan, AsyncCallback, Object) OnBeginCreateMessageSender(String, String, TimeSpan, AsyncCallback, Object)

Executes the begin create message sender action.

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

The name of the transfer destination entity.

viaEntityName
String String

The via-entity name.

timeout
TimeSpan TimeSpan

The timeout.

callback
AsyncCallback AsyncCallback

The callback message.

state
Object Object

The state.

Returns

An IAsyncResult object that references the asynchronous create message sender action.

OnBeginCreateMessageSender(String, TimeSpan, AsyncCallback, Object) OnBeginCreateMessageSender(String, TimeSpan, AsyncCallback, Object)

Executes the begin create message sender action.

protected virtual IAsyncResult OnBeginCreateMessageSender(string entityName, TimeSpan timeout, AsyncCallback callback, object state)Protected Overridable Function OnBeginCreateMessageSender(entityName As String, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
Parameters
entityName
String String

The name of the entity.

timeout
TimeSpan TimeSpan

The timeout.

callback
AsyncCallback AsyncCallback

The callback.

state
Object Object

The state.

Returns

An IAsyncResult object that references the asynchronous create message sender action.

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 timeout.

Overrides

OnCreateEventHubClient(String) OnCreateEventHubClient(String)

Executes the create event hub client action.

protected virtual EventHubClient OnCreateEventHubClient(string path)Protected Overridable Function OnCreateEventHubClient(path As String) As EventHubClient
Parameters
path
String String

The path of the event hub client.

Returns

OnCreateMessageReceiver(String, ReceiveMode, TimeSpan) OnCreateMessageReceiver(String, ReceiveMode, TimeSpan)

Executes the create message receiver action.

protected virtual MessageReceiver OnCreateMessageReceiver(string entityName, ReceiveMode receiveMode, TimeSpan timeout)Protected Overridable Function OnCreateMessageReceiver(entityName As String, receiveMode As ReceiveMode, timeout As TimeSpan) As MessageReceiver
Parameters
entityName
String String

The name of the entity.

receiveMode
ReceiveMode ReceiveMode

The message receive mode.

timeout
TimeSpan TimeSpan

The timeout.

Returns

An IAsyncResult object that references the asynchronous create message receiver action.

OnCreateMessageSender(String, String, TimeSpan) OnCreateMessageSender(String, String, TimeSpan)

Executes the create message sender action.

protected virtual MessageSender OnCreateMessageSender(string transferDestinationEntityName, string viaEntityName, TimeSpan timeout)Protected Overridable Function OnCreateMessageSender(transferDestinationEntityName As String, viaEntityName As String, timeout As TimeSpan) As MessageSender
Parameters
transferDestinationEntityName
String String

The name of the transfer destination entity.

viaEntityName
String String

The via-entity name.

timeout
TimeSpan TimeSpan

The message timeout.

Returns

OnCreateMessageSender(String, TimeSpan) OnCreateMessageSender(String, TimeSpan)

Executes the create message sender action.

protected virtual MessageSender OnCreateMessageSender(string entityName, TimeSpan timeout)Protected Overridable Function OnCreateMessageSender(entityName As String, timeout As TimeSpan) As MessageSender
Parameters
entityName
String String

The name of the entity.

timeout
TimeSpan TimeSpan

The timeout.

Returns

An IAsyncResult object that references the asynchronous create message sender action.

OnCreateQueueClient(String, ReceiveMode) OnCreateQueueClient(String, ReceiveMode)

Executes the create queue client action.

protected virtual QueueClient OnCreateQueueClient(string path, ReceiveMode receiveMode)Protected Overridable Function OnCreateQueueClient(path As String, receiveMode As ReceiveMode) As QueueClient
Parameters
path
String String

The path of the queue relative to the service namespace base address.

receiveMode
ReceiveMode ReceiveMode

The receive mode.

Returns

The newly created queue client.

OnCreateSubscriptionClient(String, ReceiveMode) OnCreateSubscriptionClient(String, ReceiveMode)

Executes a create subscription client action.

protected virtual SubscriptionClient OnCreateSubscriptionClient(string subscriptionPath, ReceiveMode receiveMode)Protected Overridable Function OnCreateSubscriptionClient(subscriptionPath As String, receiveMode As ReceiveMode) As SubscriptionClient
Parameters
subscriptionPath
String String

The subscription path.

receiveMode
ReceiveMode ReceiveMode

The receive mode.

Returns

A newly created subscription client.

OnCreateSubscriptionClient(String, String, ReceiveMode) OnCreateSubscriptionClient(String, String, ReceiveMode)

Executes a create subscription client action.

protected virtual SubscriptionClient OnCreateSubscriptionClient(string topicPath, string name, ReceiveMode receiveMode)Protected Overridable Function OnCreateSubscriptionClient(topicPath As String, name As String, receiveMode As ReceiveMode) As SubscriptionClient
Parameters
topicPath
String String

The path of the subscription relative to the service namespace base address.

name
String String

The name of the subscription.

receiveMode
ReceiveMode ReceiveMode

The receive mode.

Returns

A newly created subscription client.

OnCreateTopicClient(String) OnCreateTopicClient(String)

Executes the create topic client action.

protected virtual TopicClient OnCreateTopicClient(string path)Protected Overridable Function OnCreateTopicClient(path As String) As TopicClient
Parameters
path
String String

The path of the topic relative to the service namespace base address.

Returns

The newly created topic client.

OnEndAcceptMessageSession(IAsyncResult) OnEndAcceptMessageSession(IAsyncResult)

Executes the end accept message session action.

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

The result of the operation.

Returns

OnEndAcceptSessionReceiver(IAsyncResult) OnEndAcceptSessionReceiver(IAsyncResult)

Executes the end accept session receiver action.

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

An IAsyncResult object that stores state information and any user-defined data for this asynchronous operation.

Returns

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

The result.

Overrides

OnEndCreateMessageReceiver(IAsyncResult) OnEndCreateMessageReceiver(IAsyncResult)

Executes the end create message receiver action.

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

The result.

Returns

OnEndCreateMessageSender(IAsyncResult) OnEndCreateMessageSender(IAsyncResult)

Executes the end create message sender action.

protected abstract MessageSender OnEndCreateMessageSender(IAsyncResult result)Protected MustOverride Function OnEndCreateMessageSender(result As IAsyncResult) As MessageSender
Parameters
result
IAsyncResult IAsyncResult

The result.

Returns

PairNamespaceAsync(PairedNamespaceOptions) PairNamespaceAsync(PairedNamespaceOptions)

Asynchronously pairs a namespace.

public Task PairNamespaceAsync(PairedNamespaceOptions options)Public Function PairNamespaceAsync(options As PairedNamespaceOptions) As Task
Parameters
options
PairedNamespaceOptions PairedNamespaceOptions

The pairing options.

Returns

The result of the operation.

ResetConnection() ResetConnection()

public virtual void ResetConnection()Public Overridable Sub ResetConnection

See Also