SALES: 1-800-867-1380
This topic has not yet been rated - Rate this topic

TopicClient Class

An anchor class used to access a Topic to perform run-time operations.

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

The TopicClient type exposes the following members.

  NameDescription
Public propertyIsClosedGets or sets a value that indicates whether the message client entity is closed. (Inherited from MessageClientEntity.)
Protected propertyIsSubQueueGets or sets a value that indicates whether the message receiver is created from a subqueue.
Public propertyMessagingFactoryGets or sets the messaging factory that was used in creating this TopicClient object.
Public propertyPathGets or sets the full pathname of the file.
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 methodBeginCloseBegins an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.)
Public methodBeginSendBegins an asynchronous operation to send a message.
Public methodBeginSendBatchBegins an asynchronous operation to send a message by batch.
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 memberCreateCreates a new instance of TopicClient.
Public methodStatic memberCreateFromConnectionStringCreates a new instance of TopicClientusing a specified connection string.
Public methodEndCloseFinishes an asynchronous operation to close the message client entity. (Inherited from MessageClientEntity.)
Public methodEndSendFinishes an asynchronous operation to send a message.
Public methodEndSendBatchFinishes an asynchronous operation to send a message.
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 methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnAbortExecutes the abort action. (Overrides MessageClientEntity::OnAbort().)
Protected methodOnBeginCloseExecutes the begin close action. (Overrides MessageClientEntity::OnBeginClose(TimeSpan, AsyncCallback, Object).)
Protected methodOnBeginCreateSenderExecutes the begin create 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 methodOnEndCloseExecutes the end close action. (Overrides MessageClientEntity::OnEndClose(IAsyncResult).)
Protected methodOnEndCreateSenderExecutes the end create 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 methodSendSends a message using the InternalSender().
Public methodSendAsyncAsynchronously sends a message using the InternalSender().
Public methodSendBatchSends a set of brokered messages (for batch processing).
Public methodSendBatchAsyncAsynchronously sends a set of brokered messages (for batch processing).
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

This abstract class is not meant to be inherited, so protected members of this class should be ignored.

// Create the MessagingFactory
MessagingFactory factory = 
MessagingFactory.Create(myServiceBusNamespaceUri, SharedSecretTokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerKey));

//********************************************************************************
//                          Sending messages to a Topic
//********************************************************************************

// Create topic client
TopicClient myTopicClient = factory.CreateTopicClient(myTopic);

// Send messages
List <object> Issues = new List <object>();
foreach (var issue in Issues)
{
   myTopicClient.Send(new BrokeredMessage(issue));
}

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.