SALES: 1-800-867-1380
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.

  NameDescription
Public propertyAddressGets the base address of the messaging factory.
Public propertyIsClosedGets or sets a value that indicates whether the message client entity is closed. (Inherited from MessageClientEntity.)
Public propertyPrefetchCountGets or sets the number of messages that the message receiver can simultaneously request.
Public propertyRetryPolicyGets or sets a retry policy associated with this instance that determines whether if the request should be retried. (Inherited from MessageClientEntity.)
Protected propertyThisLockGents an object used for locking the MessageClientEntity instance. (Inherited from MessageClientEntity.)
Top
  NameDescription
Public methodAbortAborts the message client entity and puts its status into a closing state. (Inherited from MessageClientEntity.)
Public methodAcceptMessageSession()Returns available sessions across all session-enabled subscriptions and queues in the service namespace.
Public methodAcceptMessageSession(TimeSpan)Returns available sessions across all session-enabled subscriptions and queues in the service namespace.
Public methodAcceptMessageSessionAsync()Asynchronously returns available sessions across all session-enabled subscriptions and queues in the service namespace.
Public methodAcceptMessageSessionAsync(TimeSpan)Asynchronously returns available sessions across all session-enabled subscriptions and queues in the service namespace.
Public methodBeginAcceptMessageSession(AsyncCallback, Object)Begin an asynchronous operation to accept a message session.
Public methodBeginAcceptMessageSession(TimeSpan, AsyncCallback, Object)Begin an asynchronous operation to accept a message session.
Public methodBeginCloseBegins an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.)
Public methodStatic memberBeginCreate(IEnumerable<String>, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(IEnumerable<Uri>, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(String, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(Uri, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(IEnumerable<String>, MessagingFactorySettings, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(IEnumerable<String>, TokenProvider, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(IEnumerable<Uri>, MessagingFactorySettings, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(IEnumerable<Uri>, TokenProvider, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(String, MessagingFactorySettings, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(String, TokenProvider, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(Uri, MessagingFactorySettings, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodStatic memberBeginCreate(Uri, TokenProvider, AsyncCallback, Object)Begins an asynchronous request to create a MessagingFactory object.
Public methodBeginCreateMessageReceiver(String, AsyncCallback, Object)Begins a create message receiver.
Public methodBeginCreateMessageReceiver(String, ReceiveMode, AsyncCallback, Object)Begins a create message receiver.
Public methodBeginCreateMessageSender(String, AsyncCallback, Object)Begins a create message sender.
Public methodBeginCreateMessageSender(String, String, AsyncCallback, Object)Begins a create message sender.
Public methodBeginPairNamespaceBegins a namespace pairing.
Public methodCloseCloses the message client entity and puts its status into a closed state. (Inherited from MessageClientEntity.)
Public methodCloseAsyncAsynchronously closes the message client entity and puts its status into a closed state. (Inherited from MessageClientEntity.)
Public methodStatic memberCreate()Creates a new messaging factory object.
Public methodStatic memberCreate(IEnumerable<String>)Creates a new MessagingFactory object.
Public methodStatic memberCreate(IEnumerable<Uri>)Creates a new MessagingFactory object.
Public methodStatic memberCreate(String)Creates a new MessagingFactory object.
Public methodStatic memberCreate(Uri)Creates a new MessagingFactory object.
Public methodStatic memberCreate(IEnumerable<String>, MessagingFactorySettings)Creates a new MessagingFactory object.
Public methodStatic memberCreate(IEnumerable<String>, TokenProvider)Creates a new MessagingFactory object.
Public methodStatic memberCreate(IEnumerable<Uri>, MessagingFactorySettings)Creates a new MessagingFactory object.
Public methodStatic memberCreate(IEnumerable<Uri>, TokenProvider)Creates a new MessagingFactory object.
Public methodStatic memberCreate(String, MessagingFactorySettings)Creates a new MessagingFactory object.
Public methodStatic memberCreate(String, TokenProvider)Creates a new MessagingFactory object.
Public methodStatic memberCreate(Uri, MessagingFactorySettings)Creates a new MessagingFactory object.
Public methodStatic memberCreate(Uri, TokenProvider)Creates a new MessagingFactory object.
Public methodStatic memberCreateAsync(IEnumerable<String>)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(IEnumerable<Uri>)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(String)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(Uri)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(IEnumerable<String>, MessagingFactorySettings)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(IEnumerable<String>, TokenProvider)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(IEnumerable<Uri>, MessagingFactorySettings)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(IEnumerable<Uri>, TokenProvider)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(String, MessagingFactorySettings)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(String, TokenProvider)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(Uri, MessagingFactorySettings)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateAsync(Uri, TokenProvider)Asynchronously creates a new messaging factory object.
Public methodStatic memberCreateFromConnectionStringCreates a new MessagingFactory object from a connection string.
Public methodCreateMessageReceiver(String)Creates a message receiver.
Public methodCreateMessageReceiver(String, ReceiveMode)Creates a message receiver.
Public methodCreateMessageReceiverAsync(String)Asynchronously creates a message receiver.
Public methodCreateMessageReceiverAsync(String, ReceiveMode)Asynchronously creates a message receiver.
Public methodCreateMessageSender(String)Creates a message sender.
Public methodCreateMessageSender(String, String)Creates a message sender.
Public methodCreateMessageSenderAsync(String)Asynchronously creates a message sender.
Public methodCreateMessageSenderAsync(String, String)Asynchronously creates a message sender.
Public methodCreateQueueClient(String)Creates a new queue client.
Public methodCreateQueueClient(String, ReceiveMode)Creates a new queue client.
Public methodCreateSubscriptionClient(String, String)Creates a subscription client.
Public methodCreateSubscriptionClient(String, String, ReceiveMode)Creates a new subscription client.
Public methodCreateTopicClientCreates a new topic client.
Public methodEndAcceptMessageSessionEnds an asynchronous request to accept a MessagingFactory object.
Public methodEndCloseFinishes an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.)
Public methodStatic memberEndCreateEnds an asynchronous request to create a MessagingFactory object.
Public methodEndCreateMessageReceiverEnds a create message receiver.
Public methodEndCreateMessageSenderEnds a create message sender.
Public methodEndPairNamespaceEnds the namespace pairing.
Public methodEquals (Inherited from Object.)
Protected methodFaultPuts the message client entity into a faulted state. (Inherited from MessageClientEntity.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetSettingsRetrieves a copy of the settings of the messaging factory.
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnAbortExecutes the abort action. (Overrides MessageClientEntity.OnAbort().)
Protected methodOnAcceptMessageSessionExecutes the accept message session.
Protected methodOnAcceptSessionReceiverExecutes the accept session receiver action.
Protected methodOnBeginAcceptMessageSessionExecutes the begin accept message session action.
Protected methodOnBeginAcceptSessionReceiverExecutes the begin accept session receiver action.
Protected methodOnBeginCloseExecutes the begin close action. (Overrides MessageClientEntity.OnBeginClose(TimeSpan, AsyncCallback, Object).)
Protected methodOnBeginCreateMessageReceiverExecutes the begin create message receiver action.
Protected methodOnBeginCreateMessageSender(String, TimeSpan, AsyncCallback, Object)Executes the begin create message sender action.
Protected methodOnBeginCreateMessageSender(String, String, TimeSpan, AsyncCallback, Object)Executes the begin create message sender action.
Protected methodOnBeginOpenExecutes upon calling the operation to begin to open the message client entity. (Inherited from MessageClientEntity.)
Protected methodOnCloseExecutes the close action. (Overrides MessageClientEntity.OnClose(TimeSpan).)
Protected methodOnClosedOccurs when the message client entity is transitioned into a closing state. (Inherited from MessageClientEntity.)
Protected methodOnCreateMessageReceiverExecutes the create message receiver action.
Protected methodOnCreateMessageSender(String, TimeSpan)Executes the create message sender action.
Protected methodOnCreateMessageSender(String, String, TimeSpan)Executes the create message sender action.
Protected methodOnCreateQueueClientExecutes the create queue client action.
Protected methodOnCreateSubscriptionClient(String, ReceiveMode)Executes a create subscription client action.
Protected methodOnCreateSubscriptionClient(String, String, ReceiveMode)Executes a create subscription client action.
Protected methodOnCreateTopicClientExecutes the create topic client action.
Protected methodOnEndAcceptMessageSessionExecutes the end accept message session action.
Protected methodOnEndAcceptSessionReceiverExecutes the end accept session receiver action.
Protected methodOnEndCloseExecutes the end close action. (Overrides MessageClientEntity.OnEndClose(IAsyncResult).)
Protected methodOnEndCreateMessageReceiverExecutes the end create message receiver action.
Protected methodOnEndCreateMessageSenderExecutes the end create message sender action.
Protected methodOnEndOpenExecutes upon calling the operation to end to open the message client entity. (Inherited from MessageClientEntity.)
Protected methodOnFaultedExecutes upon calling the Fault operation. (Inherited from MessageClientEntity.)
Protected methodOnOpenExecutes upon calling the operation to open the message client entity. (Inherited from MessageClientEntity.)
Protected methodOnOpenedExecutes when the message client entity is opened. (Inherited from MessageClientEntity.)
Public methodPairNamespaceAsyncAsynchronously pairs a namespace.
Protected methodThrowIfClosedThrows an exception if the message client entity is closed. (Inherited from MessageClientEntity.)
Protected methodThrowIfDisposedThrows an exception if the message client entity is disposed. (Inherited from MessageClientEntity.)
Protected methodThrowIfDisposedOrImmutableThrows an exception if the client is disposed or immutable. (Inherited from MessageClientEntity.)
Protected methodThrowIfDisposedOrNotOpenThrows an exception if the client is disposed or not open. (Inherited from MessageClientEntity.)
Protected methodThrowIfFaultedThrows an exception if the client is faulted. (Inherited from MessageClientEntity.)
Public methodToString (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.

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Instance members are also guaranteed to be thread safe.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.