ServiceBusReceiver.ReceiveDeferredMessageAsync Method

Definition

Receives a deferred message identified by 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)

Parameters

sequenceNumber
Int64

The sequence number of the message to receive. This corresponds to the SequenceNumber.

cancellationToken
CancellationToken

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

Returns

Task<ServiceBusReceivedMessage>

The deferred message identified by the specified sequence number. Throws if the message has 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