MessagingFactory.CreateTopicClient Method (Topic)

Creates a new topic client.

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus.Messaging (in Microsoft.ServiceBus.Messaging.dll)

Syntax

'Declaration
Public Function CreateTopicClient ( _
    topic As Topic _
) As TopicClient
'Usage
Dim instance As MessagingFactory
Dim topic As Topic
Dim returnValue As TopicClient

returnValue = instance.CreateTopicClient(topic)
public TopicClient CreateTopicClient(
    Topic topic
)
public:
TopicClient^ CreateTopicClient(
    Topic^ topic
)
member CreateTopicClient : 
        topic:Topic -> TopicClient 
public function CreateTopicClient(
    topic : Topic
) : TopicClient

Parameters

Return Value

Type: Microsoft.ServiceBus.Messaging.TopicClient
The newly-created topic client.

Exceptions

Exception Condition
ArgumentNullException

topic is null.

TimeoutException

The operation times out. The timeout period is initialized through the MessagingFactorySettings object. You may need to increase the value of OperationTimeout to avoid this exception if the timeout value is relatively low.

MessagingException

An internal error or unexpected exception occurs.

Remarks

The TopicClient class is used as an anchor class to perform run-time operations, such as creating sender/receiver or add/remove subscription.

See Also

Reference

MessagingFactory Class

CreateTopicClient Overload

Microsoft.ServiceBus.Messaging Namespace