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

MessageReceiver.ReceiveAsync 方法

定义

重载

ReceiveAsync(TimeSpan)

异步接收来自当前队列或主题的消息。

ReceiveAsync()

异步接收来自当前队列或主题的消息。

ReceiveAsync(Int64)

异步接收来自当前队列或主题的延迟消息。 此方法仅适用于延迟消息,不适用于常规消息。

ReceiveAsync(TimeSpan)

异步接收来自当前队列或主题的消息。

public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.BrokeredMessage> ReceiveAsync (TimeSpan serverWaitTime);
abstract member ReceiveAsync : TimeSpan -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.BrokeredMessage>
override this.ReceiveAsync : TimeSpan -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.BrokeredMessage>
Public Function ReceiveAsync (serverWaitTime As TimeSpan) As Task(Of BrokeredMessage)

参数

serverWaitTime
TimeSpan

服务器在操作超时之前等待的时间跨度。

返回

异步操作。

适用于

ReceiveAsync()

异步接收来自当前队列或主题的消息。

public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.BrokeredMessage> ReceiveAsync ();
abstract member ReceiveAsync : unit -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.BrokeredMessage>
override this.ReceiveAsync : unit -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.BrokeredMessage>
Public Function ReceiveAsync () As Task(Of BrokeredMessage)

返回

异步操作。

适用于

ReceiveAsync(Int64)

异步接收来自当前队列或主题的延迟消息。 此方法仅适用于延迟消息,不适用于常规消息。

public System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.BrokeredMessage> ReceiveAsync (long sequenceNumber);
abstract member ReceiveAsync : int64 -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.BrokeredMessage>
override this.ReceiveAsync : int64 -> System.Threading.Tasks.Task<Microsoft.ServiceBus.Messaging.BrokeredMessage>
Public Function ReceiveAsync (sequenceNumber As Long) As Task(Of BrokeredMessage)

参数

sequenceNumber
Int64

要接收的延迟消息的序列号。

返回

异步操作。

适用于