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

ServiceBusReceiver.ReceiveDeferredMessageAsync 方法

定义

接收由 标识的 sequenceNumber延迟消息。

public virtual System.Threading.Tasks.Task<Azure.Messaging.ServiceBus.ServiceBusReceivedMessage> ReceiveDeferredMessageAsync (long sequenceNumber, System.Threading.CancellationToken cancellationToken = default);
abstract member ReceiveDeferredMessageAsync : int64 * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Messaging.ServiceBus.ServiceBusReceivedMessage>
override this.ReceiveDeferredMessageAsync : int64 * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Messaging.ServiceBus.ServiceBusReceivedMessage>
Public Overridable Function ReceiveDeferredMessageAsync (sequenceNumber As Long, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ServiceBusReceivedMessage)

参数

sequenceNumber
Int64

要接收的消息的序列号。 这对应于 SequenceNumber

cancellationToken
CancellationToken

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

返回

由指定的序列号标识的延迟消息。 如果消息尚未延迟,则引发 。

例外

指定的序列号与已延迟的消息不对应。 在这种情况下, Reason 将设置为 MessageNotFound

适用于

另请参阅