ReceiveMessageRequest Class

.NET Framework 4.5
 
 
 
Did this page help you?  Yes  No   Tell us about it...
Container for the parameters to the ReceiveMessage operation.

Retrieves one or more messages from the specified queue, including the message body and message ID of each message. Messages returned by this action stay in the queue until you delete them. However, once a message is returned to a ReceiveMessage request, it is not returned on subsequent ReceiveMessage requests for the duration of the VisibilityTimeout . If you do not specify a VisibilityTimeout in the request, the overall visibility timeout for the queue is used for the returned messages.

If a message is available in the queue, the call will return immediately. Otherwise, it will wait up to WaitTimeSeconds for a message to arrive. If you do not specify WaitTimeSeconds in the request, the queue attribute ReceiveMessageWaitTimeSeconds is used to determine how long to wait.

You could ask for additional information about each message through the attributes. Attributes that can be requested are [SenderId, ApproximateFirstReceiveTimestamp, ApproximateReceiveCount, SentTimestamp] .

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.SQS.Model.ReceiveMessageRequest

Namespace: Amazon.SQS.Model
Assembly: AWSSDK.dll
Version: 2.0.0.3

Syntax

C#
public class ReceiveMessageRequest : AmazonWebServiceRequest
         IRequestEvents

The ReceiveMessageRequest type exposes the following members

Constructors

  Name Description
Public Method ReceiveMessageRequest()

Properties

  Name Description
Public Property AttributeNames A list of attributes that need to be returned along with each message. The set of valid attributes are [SenderId, ApproximateFirstReceiveTimestamp, ApproximateReceiveCount, SentTimestamp].
Public Property MaxNumberOfMessages The maximum number of messages to return. Amazon SQS never returns more messages than this value but may return fewer. All of the messages are not necessarily returned.
Public Property QueueUrl The URL of the SQS queue to take action on.
Public Property VisibilityTimeout The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request.
Public Property WaitTimeSeconds The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning. If a message is available, the call will return sooner than WaitTimeSeconds.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

.NET for Windows Store apps:
Supported in: Windows 8

.NET for Windows Phone:
Supported in: Window Phone 8