Share via


ServiceBusNamespaceClient.CreateTopic Method (String)

Creates a new topic with the given service namespace path.

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

Syntax

'Declaration
Public Function CreateTopic ( _
    path As String _
) As Topic
'Usage
Dim instance As ServiceBusNamespaceClient
Dim path As String
Dim returnValue As Topic

returnValue = instance.CreateTopic(path)
public Topic CreateTopic(
    string path
)
public:
Topic^ CreateTopic(
    String^ path
)
member CreateTopic : 
        path:string -> Topic 
public function CreateTopic(
    path : String
) : Topic

Parameters

  • path
    Type: System.String
    Path of the topic relative to the service namespace base address.

Return Value

Type: Microsoft.ServiceBus.Messaging.Topic
A Topic.

Exceptions

Exception Condition
ArgumentException

path is null or empty, or path begins or ends with “/”.

ArgumentOutOfRangeException

Length of path is greater than QueueNameMaximumLength().

TimeoutException

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

MessagingEntityAlreadyExistsException

A queue or a topic with the same name and path exists under the same service namespace.

UnauthorizedAccessException

The ServiceBusNamespaceClient object does not have sufficient permission to perform this operation. You should check to ensure that your ServiceBusNamespaceClient has the correct Credential credentials to perform this operation.

QuotaExceededException

The maximum allowable quota has been reached. You must delete existing entities or increase your quota size.

MessagingException

An internal error or unexpected exception occurs.

See Also

Reference

ServiceBusNamespaceClient Class

CreateTopic Overload

Microsoft.ServiceBus Namespace