你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ServiceBusAdministrationClient.GetTopicRuntimePropertiesAsync 方法

定义

检索主题的运行时属性。

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

参数

name
String

相对于服务总线命名空间的主题的名称。

cancellationToken
CancellationToken

一个可选 CancellationToken 实例,用于发出取消操作的请求信号。

返回

TopicRuntimeProperties 包含有关主题的运行时属性。

例外

操作超时。超时期限是通过 ServiceBusAdministrationClientOptions 类初始化的 (请参阅 retry 属性) 。 如果超时值相对较低,可能需要增加超时值以避免此异常。

具有此名称的主题不存在。

服务器繁忙。 在重试操作之前,应等待。

主题名称为 null 或空。

主题名称超出了允许的最大长度。

否则,主题名称无效。

  • 找不到指定的实体。 在这种情况下, Reason 将设置为 MessagingEntityNotFound
  • 操作超时。在这种情况下, Reason 将设置为 ServiceTimeout
  • 服务器繁忙。 在重试操作之前,应等待。 在这种情况下,失败原因将设置为 ServiceBusy
  • 发生内部错误或意外异常。 在这种情况下,失败原因将设置为 GeneralError

适用于