AmazonSQSClient.ReceiveMessage Method (ReceiveMessageRequest)

.NET Framework 4.5
 
 
 
Did this page help you?  Yes  No   Tell us about it...

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] .

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

Syntax

C#
public virtual ReceiveMessageResponse ReceiveMessage(
         ReceiveMessageRequest request
)

Parameters

request
Type: Amazon.SQS.Model.ReceiveMessageRequest

Return Value
Type: Amazon.SQS.Model.ReceiveMessageResponse
The response from the ReceiveMessage service method, as returned by AmazonSQS.

Exceptions

Version Information

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