CloudQueue.GetMessages Method (Int32, Nullable<TimeSpan>, QueueRequestOptions, OperationContext)


Updated: February 24, 2017

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.

Namespace:   Microsoft.WindowsAzure.Storage.Queue
Assembly:  Microsoft.WindowsAzure.Storage (in Microsoft.WindowsAzure.Storage.dll)

public virtual IEnumerable<CloudQueueMessage> GetMessages(
	int messageCount,
	Nullable<TimeSpan> visibilityTimeout = null,
	QueueRequestOptions options = null,
	OperationContext operationContext = null


Type: System.Int32

The number of messages to retrieve.

Type: System.Nullable<TimeSpan>

A TimeSpan specifying the visibility timeout interval.

Type: Microsoft.WindowsAzure.Storage.Queue.QueueRequestOptions

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

Type: Microsoft.WindowsAzure.Storage.OperationContext

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

Return Value

Type: System.Collections.Generic.IEnumerable<CloudQueueMessage>

An enumerable collection of messages.

Return to top