ManagementClient.CreateTopicAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CreateTopicAsync(TopicDescription, CancellationToken) |
Creates a new topic in the service namespace with the given name. |
CreateTopicAsync(String, CancellationToken) |
Creates a new topic in the service namespace with the given name. |
CreateTopicAsync(TopicDescription, CancellationToken)
- Source:
- ManagementClient.cs
Creates a new topic in the service namespace with the given name.
public virtual System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.Management.TopicDescription> CreateTopicAsync (Microsoft.Azure.ServiceBus.Management.TopicDescription topicDescription, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateTopicAsync : Microsoft.Azure.ServiceBus.Management.TopicDescription * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.Management.TopicDescription>
override this.CreateTopicAsync : Microsoft.Azure.ServiceBus.Management.TopicDescription * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.Management.TopicDescription>
Public Overridable Function CreateTopicAsync (topicDescription As TopicDescription, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TopicDescription)
Parameters
- topicDescription
- TopicDescription
A TopicDescription object describing the attributes with which the new topic will be created.
- cancellationToken
- CancellationToken
Returns
The TopicDescription of the newly created topic.
Exceptions
Topic description is null.
A topic with the same name exists under the same service namespace.
The operation times out. The timeout period is initialized through the ServiceBusConnection class. You may need to increase the value of timeout to avoid this exception if the timeout value is relatively low.
No sufficient permission to perform this operation. You should check to ensure that your ManagementClient has the correct TokenProvider credentials to perform this operation.
Either the specified size in the description is not supported or the maximum allowable quota has been reached. You must specify one of the supported size values, delete existing entities, or increase your quota size.
The server is busy. You should wait before you retry the operation.
An internal error or unexpected exception occurs.
Remarks
Throws if a topic already exists. TopicDescription for default values of topic properties.
Applies to
CreateTopicAsync(String, CancellationToken)
- Source:
- ManagementClient.cs
Creates a new topic in the service namespace with the given name.
public virtual System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.Management.TopicDescription> CreateTopicAsync (string topicPath, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateTopicAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.Management.TopicDescription>
override this.CreateTopicAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.ServiceBus.Management.TopicDescription>
Public Overridable Function CreateTopicAsync (topicPath As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TopicDescription)
Parameters
- topicPath
- String
The name of the topic relative to the service namespace base address.
- cancellationToken
- CancellationToken
Returns
The TopicDescription of the newly created topic.
Exceptions
Topic name is null or empty.
The length of topicPath
is greater than 260 characters.
A topic with the same name exists under the same service namespace.
The operation times out. The timeout period is initialized through the ServiceBusConnection class. You may need to increase the value of timeout to avoid this exception if the timeout value is relatively low.
No sufficient permission to perform this operation. You should check to ensure that your ManagementClient has the correct TokenProvider credentials to perform this operation.
Either the specified size in the description is not supported or the maximum allowable quota has been reached. You must specify one of the supported size values, delete existing entities, or increase your quota size.
The server is busy. You should wait before you retry the operation.
An internal error or unexpected exception occurs.
Remarks
Throws if a topic already exists. TopicDescription for default values of topic properties.
Applies to
Azure SDK for .NET