共用方式為


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
MessagingFactory

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

Gets the base address of the messaging factory.

IsClosed (Inherited from ClientEntity)
NamespaceEndpoints

Gets a list of namespace endpoints.

PrefetchCount

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

RetryPolicy (Inherited from ClientEntity)
ThisLock (Inherited from ClientEntity)

Methods

Abort()

Performs abort functionality on the messaging entity.

(Inherited from ClientEntity)
AcceptMessageSession()

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

AcceptMessageSession(TimeSpan)

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

AcceptMessageSessionAsync()

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

AcceptMessageSessionAsync(TimeSpan)

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

Close()

Sends a cleanup message to Service Bus to signal the completion of the usage of an entity.

(Inherited from ClientEntity)
CloseAsync()

Sends a cleanup message asynchronously to Service Bus to signal the completion of the usage of an entity.

(Inherited from ClientEntity)
Create()

Creates a new messaging factory object.

Create(IEnumerable<String>, MessagingFactorySettings)

Creates a new MessagingFactory object.

Create(IEnumerable<String>, TokenProvider)

Creates a new MessagingFactory object.

Create(IEnumerable<String>)

Creates a new MessagingFactory object.

Create(IEnumerable<Uri>, MessagingFactorySettings)

Creates a new MessagingFactory object.

Create(IEnumerable<Uri>, TokenProvider)

Creates a new MessagingFactory object.

Create(IEnumerable<Uri>)

Creates a new MessagingFactory object.

Create(String, MessagingFactorySettings)

Creates a new MessagingFactory object.

Create(String, TokenProvider)

Creates a new MessagingFactory object.

Create(String)

Creates a new MessagingFactory object.

Create(Uri, MessagingFactorySettings)

Creates a new MessagingFactory object.

Create(Uri, TokenProvider)

Creates a new MessagingFactory object.

Create(Uri)

Creates a new MessagingFactory object.

CreateAsync(IEnumerable<String>, MessagingFactorySettings)

Asynchronously creates a new messaging factory object.

CreateAsync(IEnumerable<String>, TokenProvider)

Asynchronously creates a new messaging factory object.

CreateAsync(IEnumerable<String>)

Asynchronously creates a new messaging factory object.

CreateAsync(IEnumerable<Uri>, MessagingFactorySettings)

Asynchronously creates a new messaging factory object.

CreateAsync(IEnumerable<Uri>, TokenProvider)

Asynchronously creates a new messaging factory object.

CreateAsync(IEnumerable<Uri>)

Asynchronously creates a new messaging factory object.

CreateAsync(String, MessagingFactorySettings)

Asynchronously creates a new messaging factory object.

CreateAsync(String, TokenProvider)

Asynchronously creates a new messaging factory object.

CreateAsync(String)

Asynchronously creates a new messaging factory object.

CreateAsync(Uri, MessagingFactorySettings)

Asynchronously creates a new messaging factory object.

CreateAsync(Uri, TokenProvider)

Asynchronously creates a new messaging factory object.

CreateAsync(Uri)

Asynchronously creates a new messaging factory object.

CreateEventHubClient(String)

Creates a new EventHubClient object using the specified path.

CreateFromConnectionString(String)

Creates a new MessagingFactory object from a connection string.

CreateMessageReceiver(String, ReceiveMode)

Creates a message receiver.

CreateMessageReceiver(String)

Creates a message receiver.

CreateMessageReceiverAsync(String, ReceiveMode)

Asynchronously creates a message receiver.

CreateMessageReceiverAsync(String)

Asynchronously creates a message receiver.

CreateMessageSender(String, String)

Creates a message sender.

CreateMessageSender(String)

Creates a message sender.

CreateMessageSenderAsync(String, String)

Asynchronously creates a message sender.

CreateMessageSenderAsync(String)

Asynchronously creates a message sender.

CreateQueueClient(String, ReceiveMode)

Creates a new queue client.

CreateQueueClient(String)

Creates a new queue client.

CreateSubscriptionClient(String, String, ReceiveMode)

Creates a new subscription client.

CreateSubscriptionClient(String, String)

Creates a subscription client.

CreateTopicClient(String)

Creates a new topic client.

Fault()

For internal use only. Do not inherit from this class.

(Inherited from ClientEntity)
GetSettings()

Retrieves a copy of the settings of the messaging factory.

IncrementConnectionResetCount(Uri)
OnAbort()

Executes the abort action.

OnAcceptMessageSession(ReceiveMode, TimeSpan, TimeSpan)

Executes the accept message session.

OnAcceptSessionReceiver(String, String, ReceiveMode, TimeSpan)

Executes the accept session receiver action.

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

Executes the begin accept message session action.

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

Executes the begin accept session receiver action.

OnBeginClose(TimeSpan, AsyncCallback, Object)

Executes the begin close action.

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

Executes the begin create message receiver action.

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

Executes the begin create message sender action.

OnBeginCreateMessageSender(String, TimeSpan, AsyncCallback, Object)

Executes the begin create message sender action.

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

Executes the close action.

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

Executes the create event hub client action.

OnCreateMessageReceiver(String, ReceiveMode, TimeSpan)

Executes the create message receiver action.

OnCreateMessageSender(String, String, TimeSpan)

Executes the create message sender action.

OnCreateMessageSender(String, TimeSpan)

Executes the create message sender action.

OnCreateQueueClient(String, ReceiveMode)

Executes the create queue client action.

OnCreateSubscriptionClient(String, ReceiveMode)

Executes a create subscription client action.

OnCreateSubscriptionClient(String, String, ReceiveMode)

Executes a create subscription client action.

OnCreateTopicClient(String)

Executes the create topic client action.

OnEndAcceptMessageSession(IAsyncResult)

Executes the end accept message session action.

OnEndAcceptSessionReceiver(IAsyncResult)

Executes the end accept session receiver action.

OnEndClose(IAsyncResult)

Executes the end close action.

OnEndCreateMessageReceiver(IAsyncResult)

Executes the end create message receiver action.

OnEndCreateMessageSender(IAsyncResult)

Executes the end create message sender action.

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

Asynchronously pairs a namespace.

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

Applies to

See also