PeekMessage

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

NameDescriptionRequired

MessageId

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

NameDescription

Message

An element containing information about the message. See the example response below.

Ancestor: PeekMessageResponse

Child: MessageId, MessageBody

MessageBody

The message's contents.

Type: String

Ancestor: Message

MessageId

The message's system-assigned ID.

Type: String

Ancestor: Message

The following table lists the special errors the action returns (in addition to the common errors listed in Common Errors).

ErrorDescriptionHTTP Status Code

MessageNotFound

No message exists with the MessageId specified.

404

The following example Query request returns the message specified by the message ID.