MessagingFactory 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 : Microsoft.ServiceBus.Messaging.ClientEntity
type MessagingFactory = class
    inherit ClientEntity
Public MustInherit Class MessagingFactory
Inherits ClientEntity
Inheritance
MessagingFactoryMessagingFactoryMessagingFactory

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);
        

        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);
        

        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);
        

        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);
        

        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);
        

        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);
        

        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);
        

        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);
        

        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);
        

        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);
        

        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);
        

        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);
        

        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 Address

Gets the base address of the messaging factory.

IsClosed IsClosed IsClosed Inherited from ClientEntity
NamespaceEndpoints NamespaceEndpoints NamespaceEndpoints

Gets a list of namespace endpoints.

PrefetchCount PrefetchCount PrefetchCount

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

RetryPolicy RetryPolicy RetryPolicy Inherited from ClientEntity
ThisLock ThisLock ThisLock Inherited from ClientEntity

Methods

Abort() Abort() Abort() Inherited from ClientEntity
AcceptMessageSession() AcceptMessageSession() AcceptMessageSession()

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

AcceptMessageSession(TimeSpan) AcceptMessageSession(TimeSpan) AcceptMessageSession(TimeSpan)

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

AcceptMessageSessionAsync() AcceptMessageSessionAsync() AcceptMessageSessionAsync()

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

AcceptMessageSessionAsync(TimeSpan) AcceptMessageSessionAsync(TimeSpan) AcceptMessageSessionAsync(TimeSpan)

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

Close() Close() Close() Inherited from ClientEntity
CloseAsync() CloseAsync() CloseAsync() Inherited from ClientEntity
Create() Create() Create()

Creates a new messaging factory object.

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

Creates a new MessagingFactory object.

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

Creates a new MessagingFactory object.

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

Creates a new MessagingFactory object.

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

Creates a new MessagingFactory object.

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

Creates a new MessagingFactory object.

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

Creates a new MessagingFactory object.

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

Creates a new MessagingFactory object.

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

Creates a new MessagingFactory object.

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

Creates a new MessagingFactory object.

Create(Uri) Create(Uri) Create(Uri)

Creates a new MessagingFactory object.

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

Creates a new MessagingFactory object.

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

Creates a new MessagingFactory object.

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

Asynchronously creates a new messaging factory object.

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

Asynchronously creates a new messaging factory object.

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

Asynchronously creates a new messaging factory object.

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

Asynchronously creates a new messaging factory object.

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

Asynchronously creates a new messaging factory object.

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

Asynchronously creates a new messaging factory object.

CreateAsync(String) CreateAsync(String) CreateAsync(String)

Asynchronously creates a new messaging factory object.

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

Asynchronously creates a new messaging factory object.

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

Asynchronously creates a new messaging factory object.

CreateAsync(Uri) CreateAsync(Uri) CreateAsync(Uri)

Asynchronously creates a new messaging factory object.

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

Asynchronously creates a new messaging factory object.

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

Asynchronously creates a new messaging factory object.

CreateEventHubClient(String) CreateEventHubClient(String) CreateEventHubClient(String)

Creates a new EventHubClient object using the specified path.

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

Creates a new MessagingFactory object from a connection string.

CreateMessageReceiver(String) CreateMessageReceiver(String) CreateMessageReceiver(String)

Creates a message receiver.

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

Creates a message receiver.

CreateMessageReceiverAsync(String) CreateMessageReceiverAsync(String) CreateMessageReceiverAsync(String)

Asynchronously creates a message receiver.

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

Asynchronously creates a message receiver.

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

Creates a message sender.

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

Creates a message sender.

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

Asynchronously creates a message sender.

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

Asynchronously creates a message sender.

CreateQueueClient(String) CreateQueueClient(String) CreateQueueClient(String)

Creates a new queue client.

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

Creates a new queue client.

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

Creates a subscription client.

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

Creates a new subscription client.

CreateTopicClient(String) CreateTopicClient(String) CreateTopicClient(String)

Creates a new topic client.

Fault() Fault() Fault() Inherited from ClientEntity
GetSettings() GetSettings() GetSettings()

Retrieves a copy of the settings of the messaging factory.

IncrementConnectionResetCount(Uri) IncrementConnectionResetCount(Uri) IncrementConnectionResetCount(Uri)
OnAbort() OnAbort() OnAbort()

Executes the abort action.

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

Executes the accept message session.

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

Executes the accept session receiver action.

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

Executes the begin accept message session action.

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

Executes the begin accept session receiver action.

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

Executes the begin close action.

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

Executes the begin create message receiver action.

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

Executes the begin create message sender action.

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

Executes the begin create message sender action.

OnBeginOpen(TimeSpan, AsyncCallback, Object) OnBeginOpen(TimeSpan, AsyncCallback, Object) OnBeginOpen(TimeSpan, AsyncCallback, Object) Inherited from ClientEntity
OnClose(TimeSpan) OnClose(TimeSpan) OnClose(TimeSpan)

Executes the close action.

OnClosed() OnClosed() OnClosed() Inherited from ClientEntity
OnCreateEventHubClient(String) OnCreateEventHubClient(String) OnCreateEventHubClient(String)

Executes the create event hub client action.

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

Executes the create message receiver action.

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

Executes the create message sender action.

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

Executes the create message sender action.

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

Executes the create queue client action.

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

Executes a create subscription client action.

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

Executes a create subscription client action.

OnCreateTopicClient(String) OnCreateTopicClient(String) OnCreateTopicClient(String)

Executes the create topic client action.

OnEndAcceptMessageSession(IAsyncResult) OnEndAcceptMessageSession(IAsyncResult) OnEndAcceptMessageSession(IAsyncResult)

Executes the end accept message session action.

OnEndAcceptSessionReceiver(IAsyncResult) OnEndAcceptSessionReceiver(IAsyncResult) OnEndAcceptSessionReceiver(IAsyncResult)

Executes the end accept session receiver action.

OnEndClose(IAsyncResult) OnEndClose(IAsyncResult) OnEndClose(IAsyncResult)

Executes the end close action.

OnEndCreateMessageReceiver(IAsyncResult) OnEndCreateMessageReceiver(IAsyncResult) OnEndCreateMessageReceiver(IAsyncResult)

Executes the end create message receiver action.

OnEndCreateMessageSender(IAsyncResult) OnEndCreateMessageSender(IAsyncResult) OnEndCreateMessageSender(IAsyncResult)

Executes the end create message sender action.

OnEndOpen(IAsyncResult) OnEndOpen(IAsyncResult) OnEndOpen(IAsyncResult) Inherited from ClientEntity
OnFaulted() OnFaulted() OnFaulted() Inherited from ClientEntity
OnOpen(TimeSpan) OnOpen(TimeSpan) OnOpen(TimeSpan) Inherited from ClientEntity
OnOpened() OnOpened() OnOpened() Inherited from ClientEntity
PairNamespaceAsync(PairedNamespaceOptions) PairNamespaceAsync(PairedNamespaceOptions) PairNamespaceAsync(PairedNamespaceOptions)

Asynchronously pairs a namespace.

ResetConnection() ResetConnection() ResetConnection()
ThrowIfClosed() ThrowIfClosed() ThrowIfClosed() Inherited from ClientEntity
ThrowIfDisposed() ThrowIfDisposed() ThrowIfDisposed() Inherited from ClientEntity
ThrowIfDisposedOrImmutable() ThrowIfDisposedOrImmutable() ThrowIfDisposedOrImmutable() Inherited from ClientEntity
ThrowIfDisposedOrNotOpen() ThrowIfDisposedOrNotOpen() ThrowIfDisposedOrNotOpen() Inherited from ClientEntity
ThrowIfFaulted() ThrowIfFaulted() ThrowIfFaulted() Inherited from ClientEntity

Extension Methods

IsDefined(Object) IsDefined(Object) IsDefined(Object)

Determines if a certain property is defined or not.

IsNull(Object) IsNull(Object) IsNull(Object)

Determines if a certain property is null or not.

IsPrimitive(Object) IsPrimitive(Object) IsPrimitive(Object)

Determines if a certain property is of premitive JSON type.

Applies to