The PeekMessage action returns the specified message regardless of the VisibilityTimeout state of the queue or message. This action doesn't modify the message's current visibility state or visibility timeout setting. See Visibility Timeout for more information.
The following table lists the special request parameters the action uses (in addition to the common request parameters listed in Common Request Parameters).
| Name | Description | Required |
|---|---|---|
| The message ID of the message to return. Type: String | Yes |
The following table lists the response elements the action returns (in addition to the common response elements listed in The Structure of a Response).
| Name | Description |
|---|---|
| An element containing information about the message. See the example response below. Ancestor: Child: |
| The message's contents. Type: String Ancestor: |
| The message's system-assigned ID. Type: String Ancestor: |
The following table lists the special errors the action returns (in addition to the common errors listed in Common Errors).
| Error | Description | HTTP Status Code |
|---|---|---|
MessageNotFound | No message exists with the | 404 |
The following example Query request returns the message specified by the message ID.
http://queue.amazonaws.com/A29E9VSPHGOG23/queue1 ?Action=PeekMessage &AWSAccessKeyId=0GS7553JW74RRM612K02EXAMPLE &Version=2007-05-01 &MessageId=17VXQHSGX0SG4ZEPPK7R%7C0QE42ST4KW7RK9HSY074%7C0Z4AN912X0H2EP8BV6XJ &Expires=2007-05-12T12:00:00Z &Signature=CN2SbNq%2B2Vw1W3lbc7wpM5gzDHEXAMPLE=
<PeekMessageResponse>
<Message>
<MessageId>
17VXQHSGX0SG4ZEPPK7R|0QE42ST4KW7RK9HSY074|0Z4AN912X0H2EP8BV6XJ
</MessageId>
<MessageBody>foo</MessageBody>
</Message>
<ResponseStatus>
<StatusCode>Success</StatusCode>
<RequestId>cb919c0a-9bce-4afe-9b48-9bdf2412bb67</RequestId>
</ResponseStatus>
</PeekMessageResponse>