This topic has not yet been rated Rate this topic

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

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)
public abstract class MessagingFactory : MessageClientEntity

The MessagingFactory type exposes the following members.

  Name Description
Public property Address Gets the base address of the messaging factory.
Public property IsClosed Gets or sets a value that indicates whether the message client entity is closed. (Inherited from MessageClientEntity.)
Top
  Name Description
Public method Abort Aborts the message client entity and puts its status into a closing state. (Inherited from MessageClientEntity.)
Public method BeginClose Begins an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.)
Public method Static member BeginCreate(String, MessagingFactorySettings, AsyncCallback, Object) Begins an asynchronous request to create a MessagingFactory object.
Public method Static member BeginCreate(String, TokenProvider, AsyncCallback, Object) Begins an asynchronous request to create a MessagingFactory object.
Public method Static member BeginCreate(Uri, MessagingFactorySettings, AsyncCallback, Object) Begins an asynchronous request to create a MessagingFactory object.
Public method Static member BeginCreate(Uri, TokenProvider, AsyncCallback, Object) Begins an asynchronous request to create a MessagingFactory object.
Public method BeginCreateMessageReceiver(String, AsyncCallback, Object) Begins a create message receiver.
Public method BeginCreateMessageReceiver(String, ReceiveMode, AsyncCallback, Object) Begins a create message receiver.
Public method BeginCreateMessageSender Begins a create message sender.
Public method Close Closes the message client entity and puts its status into a closed state. (Inherited from MessageClientEntity.)
Public method Static member Create(String, MessagingFactorySettings) Creates a new MessagingFactory object.
Public method Static member Create(String, TokenProvider) Creates a new MessagingFactory object.
Public method Static member Create(Uri, MessagingFactorySettings) Creates a new MessagingFactory object.
Public method Static member Create(Uri, TokenProvider) Creates a new MessagingFactory object.
Public method CreateMessageReceiver(String) Creates a message receiver.
Public method CreateMessageReceiver(String, ReceiveMode) Creates a message receiver.
Public method CreateMessageSender Creates a message sender.
Public method CreateQueueClient(String) Creates a new queue client.
Public method CreateQueueClient(String, ReceiveMode) Creates a new queue client.
Public method CreateSubscriptionClient(String, String) Creates a subscription client.
Public method CreateSubscriptionClient(String, String, ReceiveMode) Creates a new subscription client.
Public method CreateTopicClient Creates a new topic client.
Public method EndClose Finishes an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.)
Public method Static member EndCreate Ends an asynchronous request to create a MessagingFactory object.
Public method EndCreateMessageReceiver Ends a create message receiver.
Public method EndCreateMessageSender Ends a create message sender.
Public method Equals (Inherited from Object.)
Protected method Fault Puts the message client entity into a faulted state. (Inherited from MessageClientEntity.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetSettings Retrieves a copy of the settings of the messaging factory.
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Protected method OnAbort Executes the abort action. (Overrides MessageClientEntity.OnAbort.)
Protected method OnAcceptSessionReceiver Executes the accept session receiver action.
Protected method OnBeginAcceptSessionReceiver Executes the begin accept session receiver action.
Protected method OnBeginClose Executes the begin close action. (Overrides MessageClientEntity.OnBeginClose(TimeSpan, AsyncCallback, Object).)
Protected method OnBeginCreateMessageReceiver Executes the begin create message receiver action.
Protected method OnBeginCreateMessageSender Executes the begin create message sender action.
Protected method OnBeginOpen Executes upon calling the operation to begin to open the message client entity. (Inherited from MessageClientEntity.)
Protected method OnClose Executes the close action. (Overrides MessageClientEntity.OnClose(TimeSpan).)
Protected method OnClosed Occurs when the message client entity is transitioned into a closing state. (Inherited from MessageClientEntity.)
Protected method OnCreateMessageReceiver Executes the create message receiver action.
Protected method OnCreateMessageSender Executes the create message sender action.
Protected method OnCreateQueueClient Executes the create queue client action.
Protected method OnCreateSubscriptionClient Executes a create subscription client action.
Protected method OnCreateTopicClient Executes the create topic client action.
Protected method OnEndAcceptSessionReceiver Executes the end accept session receiver action.
Protected method OnEndClose Executes the end close action. (Overrides MessageClientEntity.OnEndClose(IAsyncResult).)
Protected method OnEndCreateMessageReceiver Executes the end create message receiver action.
Protected method OnEndCreateMessageSender Executes the end create message sender action.
Protected method OnEndOpen Executes upon calling the operation to end to open the message client entity. (Inherited from MessageClientEntity.)
Protected method OnFaulted Executes upon calling the Fault operation. (Inherited from MessageClientEntity.)
Protected method OnOpen Executes upon calling the operation to open the message client entity. (Inherited from MessageClientEntity.)
Protected method OnOpened Executes when the message client entity is opened. (Inherited from MessageClientEntity.)
Protected method ThrowIfClosed Throws an exception if the message client entity is closed. (Inherited from MessageClientEntity.)
Protected method ThrowIfDisposed Throws an exception if the message client entity is disposed. (Inherited from MessageClientEntity.)
Protected method ThrowIfDisposedOrImmutable Throws an exception if the client is disposed or immutable. (Inherited from MessageClientEntity.)
Protected method ThrowIfDisposedOrNotOpen Throws an exception if the client is disposed or not open. (Inherited from MessageClientEntity.)
Protected method ThrowIfFaulted Throws an exception if the client is faulted. (Inherited from MessageClientEntity.)
Public method ToString (Inherited from Object.)
Top

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.

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);
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)