共用方式為


ServiceBusReceiver.ReceiveDeferredMessagesAsync Method

Definition

Receives a list of deferred messages identified by sequenceNumbers.

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

Parameters

sequenceNumbers
IEnumerable<Int64>

An IEnumerable<T> containing the sequence numbers to receive.

cancellationToken
CancellationToken

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

Returns

Messages identified by sequence number are returned. Throws if the messages have not been deferred.

Exceptions

The specified sequence number does not correspond to a message that has been deferred. The Reason will be set to MessageNotFound in this case.

Applies to

See also