共用方式為


ServiceBusAdministrationClient.TopicExistsAsync Method

Definition

Checks whether a given topic exists or not.

public virtual System.Threading.Tasks.Task<Azure.Response<bool>> TopicExistsAsync (string name, System.Threading.CancellationToken cancellationToken = default);
abstract member TopicExistsAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<bool>>
override this.TopicExistsAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<bool>>
Public Overridable Function TopicExistsAsync (name As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of Boolean))

Parameters

name
String

Name of the topic entity to check.

cancellationToken
CancellationToken

An optional CancellationToken instance to signal the request to cancel the operation.

Returns

True if topic exists, false otherwise.

Exceptions

The operation times out.

The server is busy. You should wait before you retry the operation.

The topic name is null or empty..

The topic name name exceeds the maximum allowed length.

The topic name is otherwise invalid.

Insufficient permission to perform this operation. You should check to ensure that your ServiceBusAdministrationClient has the necessary claims to perform this operation. https://learn.microsoft.com/azure/service-bus-messaging/service-bus-sas#rights-required-for-service-bus-operations

  • The operation timed out. The Reason will be set to ServiceTimeout in this case.
  • The server is busy. You should wait before you retry the operation. The failure reason will be set to ServiceBusy in this case.
  • An internal error or unexpected exception occurs. The failure reason will be set to GeneralError in this case.

Applies to