MessagingFactory Class
Represents a messaging factory. This is the anchor class used for run-time operations to send and receive to and from queues, topics, or subscriptions.
System.Object
Microsoft.ServiceBus.Messaging.MessageClientEntity
Microsoft.ServiceBus.Messaging.MessagingFactory
Microsoft.ServiceBus.Messaging.MessageClientEntity
Microsoft.ServiceBus.Messaging.MessagingFactory
Namespace: Microsoft.ServiceBus.Messaging
Assembly: Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)
The MessagingFactory type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Address | Gets the base address of the messaging factory. |
![]() | IsClosed | Gets or sets a value that indicates whether the message client entity is closed. (Inherited from MessageClientEntity.) |
![]() | PrefetchCount | Gets or sets the number of messages that the message receiver can simultaneously request. |
![]() | ThisLock | Gents an object used for locking the MessageClientEntity instance. (Inherited from MessageClientEntity.) |
| Name | Description | |
|---|---|---|
![]() | Abort | Aborts the message client entity and puts its status into a closing state. (Inherited from MessageClientEntity.) |
![]() | 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. |
![]() | BeginAcceptMessageSession(AsyncCallback, Object) | Begin an asynchronous operation to accept a message session. |
![]() | BeginAcceptMessageSession(TimeSpan, AsyncCallback, Object) | Begin an asynchronous operation to accept a message session. |
![]() | BeginClose | Begins an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.) |
![]() ![]() | BeginCreate(IEnumerable<String>, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(IEnumerable<Uri>, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(String, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(Uri, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(IEnumerable<String>, MessagingFactorySettings, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(IEnumerable<String>, TokenProvider, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(IEnumerable<Uri>, MessagingFactorySettings, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(IEnumerable<Uri>, TokenProvider, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(String, MessagingFactorySettings, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(String, TokenProvider, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(Uri, MessagingFactorySettings, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() ![]() | BeginCreate(Uri, TokenProvider, AsyncCallback, Object) | Begins an asynchronous request to create a MessagingFactory object. |
![]() | BeginCreateMessageReceiver(String, AsyncCallback, Object) | Begins a create message receiver. |
![]() | BeginCreateMessageReceiver(String, ReceiveMode, AsyncCallback, Object) | Begins a create message receiver. |
![]() | BeginCreateMessageSender(String, AsyncCallback, Object) | Begins a create message sender. |
![]() | BeginCreateMessageSender(String, String, AsyncCallback, Object) | Begins a create message sender. |
![]() | Close | Closes the message client entity and puts its status into a closed state. (Inherited from MessageClientEntity.) |
![]() | CloseAsync | Asynchronously closes the message client entity and puts its status into a closed state. (Inherited from MessageClientEntity.) |
![]() ![]() | Create() | Creates a new messaging factory object. |
![]() ![]() | Create(IEnumerable<String>) | Creates a new MessagingFactory object. |
![]() ![]() | Create(IEnumerable<Uri>) | Creates a new MessagingFactory object. |
![]() ![]() | Create(String) | Creates a new MessagingFactory object. |
![]() ![]() | Create(Uri) | Creates a new MessagingFactory object. |
![]() ![]() | Create(IEnumerable<String>, MessagingFactorySettings) | Creates a new MessagingFactory object. |
![]() ![]() | Create(IEnumerable<String>, TokenProvider) | Creates a new MessagingFactory object. |
![]() ![]() | Create(IEnumerable<Uri>, MessagingFactorySettings) | Creates a new MessagingFactory object. |
![]() ![]() | Create(IEnumerable<Uri>, TokenProvider) | Creates a new MessagingFactory object. |
![]() ![]() | Create(String, MessagingFactorySettings) | Creates a new MessagingFactory object. |
![]() ![]() | Create(String, TokenProvider) | Creates a new MessagingFactory object. |
![]() ![]() | Create(Uri, MessagingFactorySettings) | Creates a new MessagingFactory object. |
![]() ![]() | Create(Uri, TokenProvider) | Creates a new MessagingFactory object. |
![]() ![]() | CreateAsync(IEnumerable<String>) | Asynchronously creates a new messaging factory object. |
![]() ![]() | CreateAsync(IEnumerable<Uri>) | Asynchronously creates a new messaging factory object. |
![]() ![]() | CreateAsync(String) | Asynchronously creates a new messaging factory object. |
![]() ![]() | CreateAsync(Uri) | Asynchronously creates a new messaging factory 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<Uri>, MessagingFactorySettings) | Asynchronously creates a new messaging factory object. |
![]() ![]() | CreateAsync(IEnumerable<Uri>, TokenProvider) | 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(Uri, MessagingFactorySettings) | Asynchronously creates a new messaging factory object. |
![]() ![]() | CreateAsync(Uri, TokenProvider) | Asynchronously creates a new messaging factory object. |
![]() ![]() | CreateFromConnectionString | Creates a new MessagingFactory object from a connection string. |
![]() | CreateMessageReceiver(String) | Creates a message receiver. |
![]() | CreateMessageReceiver(String, ReceiveMode) | Creates a message receiver. |
![]() | CreateMessageReceiverAsync(String) | Asynchronously creates a message receiver. |
![]() | CreateMessageReceiverAsync(String, ReceiveMode) | Asynchronously creates a message receiver. |
![]() | CreateMessageSender(String) | Creates a message sender. |
![]() | CreateMessageSender(String, String) | Creates a message sender. |
![]() | CreateMessageSenderAsync(String) | Asynchronously creates a message sender. |
![]() | CreateMessageSenderAsync(String, String) | Asynchronously creates a message sender. |
![]() | CreateQueueClient(String) | Creates a new queue client. |
![]() | CreateQueueClient(String, ReceiveMode) | Creates a new queue client. |
![]() | CreateSubscriptionClient(String, String) | Creates a subscription client. |
![]() | CreateSubscriptionClient(String, String, ReceiveMode) | Creates a new subscription client. |
![]() | CreateTopicClient | Creates a new topic client. |
![]() | EndAcceptMessageSession | Ends an asynchronous request to accept a MessagingFactory object. |
![]() | EndClose | Finishes an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.) |
![]() ![]() | EndCreate | Ends an asynchronous request to create a MessagingFactory object. |
![]() | EndCreateMessageReceiver | Ends a create message receiver. |
![]() | EndCreateMessageSender | Ends a create message sender. |
![]() | Equals | (Inherited from Object.) |
![]() | Fault | Puts the message client entity into a faulted state. (Inherited from MessageClientEntity.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetSettings | Retrieves a copy of the settings of the messaging factory. |
![]() | GetType | (Inherited from Object.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | OnAbort | Executes the abort action. (Overrides MessageClientEntity.OnAbort().) |
![]() | OnAcceptMessageSession | Executes the accept message session. |
![]() | OnAcceptSessionReceiver | Executes the accept session receiver action. |
![]() | OnBeginAcceptMessageSession | Executes the begin accept message session action. |
![]() | OnBeginAcceptSessionReceiver | Executes the begin accept session receiver action. |
![]() | OnBeginClose | Executes the begin close action. (Overrides MessageClientEntity.OnBeginClose(TimeSpan, AsyncCallback, Object).) |
![]() | OnBeginCreateMessageReceiver | Executes the begin create message receiver action. |
![]() | OnBeginCreateMessageSender(String, TimeSpan, AsyncCallback, Object) | Executes the begin create message sender action. |
![]() | OnBeginCreateMessageSender(String, String, TimeSpan, AsyncCallback, Object) | Executes the begin create message sender action. |
![]() | OnBeginOpen | Executes upon calling the operation to begin to open the message client entity. (Inherited from MessageClientEntity.) |
![]() | OnClose | Executes the close action. (Overrides MessageClientEntity.OnClose(TimeSpan).) |
![]() | OnClosed | Occurs when the message client entity is transitioned into a closing state. (Inherited from MessageClientEntity.) |
![]() | OnCreateMessageReceiver | Executes the create message receiver action. |
![]() | OnCreateMessageSender(String, TimeSpan) | Executes the create message sender action. |
![]() | OnCreateMessageSender(String, String, TimeSpan) | Executes the create message sender action. |
![]() | OnCreateQueueClient | 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 | Executes the create topic client action. |
![]() | OnEndAcceptMessageSession | Executes the end accept message session action. |
![]() | OnEndAcceptSessionReceiver | Executes the end accept session receiver action. |
![]() | OnEndClose | Executes the end close action. (Overrides MessageClientEntity.OnEndClose(IAsyncResult).) |
![]() | OnEndCreateMessageReceiver | Executes the end create message receiver action. |
![]() | OnEndCreateMessageSender | Executes the end create message sender action. |
![]() | OnEndOpen | Executes upon calling the operation to end to open the message client entity. (Inherited from MessageClientEntity.) |
![]() | OnFaulted | Executes upon calling the Fault operation. (Inherited from MessageClientEntity.) |
![]() | OnOpen | Executes upon calling the operation to open the message client entity. (Inherited from MessageClientEntity.) |
![]() | OnOpened | Executes when the message client entity is opened. (Inherited from MessageClientEntity.) |
![]() | ThrowIfClosed | Throws an exception if the message client entity is closed. (Inherited from MessageClientEntity.) |
![]() | ThrowIfDisposed | Throws an exception if the message client entity is disposed. (Inherited from MessageClientEntity.) |
![]() | ThrowIfDisposedOrImmutable | Throws an exception if the client is disposed or immutable. (Inherited from MessageClientEntity.) |
![]() | ThrowIfDisposedOrNotOpen | Throws an exception if the client is disposed or not open. (Inherited from MessageClientEntity.) |
![]() | ThrowIfFaulted | Throws an exception if the client is faulted. (Inherited from MessageClientEntity.) |
![]() | ToString | (Inherited from Object.) |
Please note that any member method with CreateXXXClient, such as CreateQueueClient(String), does not create a new entity in the service namespace. It only retrieves a handle to an existing entity created earlier using the NamespaceManager object. If these entities do not exist in the service namespace, you will receive an exception.
Also note that settings are only applied when provided through constructor methods and cannot be modified later.
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);




