Sdílet prostřednictvím


CloudQueue.GetMessages Method

Definition

Gets the specified number of messages from the queue using the specified request options and operation context. This operation marks the retrieved messages as invisible in the queue for the default visibility timeout period.

[Microsoft.Azure.Storage.DoesServiceRequest]
public virtual System.Collections.Generic.IEnumerable<Microsoft.Azure.Storage.Queue.CloudQueueMessage> GetMessages (int messageCount, TimeSpan? visibilityTimeout = default, Microsoft.Azure.Storage.Queue.QueueRequestOptions options = default, Microsoft.Azure.Storage.OperationContext operationContext = default);
[<Microsoft.Azure.Storage.DoesServiceRequest>]
abstract member GetMessages : int * Nullable<TimeSpan> * Microsoft.Azure.Storage.Queue.QueueRequestOptions * Microsoft.Azure.Storage.OperationContext -> seq<Microsoft.Azure.Storage.Queue.CloudQueueMessage>
override this.GetMessages : int * Nullable<TimeSpan> * Microsoft.Azure.Storage.Queue.QueueRequestOptions * Microsoft.Azure.Storage.OperationContext -> seq<Microsoft.Azure.Storage.Queue.CloudQueueMessage>
Public Overridable Function GetMessages (messageCount As Integer, Optional visibilityTimeout As Nullable(Of TimeSpan) = Nothing, Optional options As QueueRequestOptions = Nothing, Optional operationContext As OperationContext = Nothing) As IEnumerable(Of CloudQueueMessage)

Parameters

messageCount
Int32

The number of messages to retrieve. The maximum number of messages that may be retrieved at one time is 32.

visibilityTimeout
Nullable<TimeSpan>

A TimeSpan specifying the visibility timeout interval.

options
QueueRequestOptions

A QueueRequestOptions object that specifies additional options for the request. If null, default options are applied to the request.

operationContext
OperationContext

An OperationContext object that represents the context for the current operation.

Returns

An enumerable collection of messages.

Attributes

Applies to