PeekMessage (SOAP)

The PeekMessage action returns a preview of the message specified by the MessageId parameter. The message is returned regardless of the VisibilityTimeout state on the queue. The visibility state is not modified when PeekMessage is used, thereby not affecting which messages get returned from a subsequent ReceiveMessage request.

A PeekMessage request is validated on the following:

Returns Success, the message body, and the message ID of the message specified if successful. It returns an error response if unsuccessful.

NameDescriptionTypeValue
MessageId Required. The message ID of the message to return.String17VXQHSGX0SG4ZEPPK7R|0QE42ST4KW7RK9HSY074|0Z4AN912X0H2EP8BV6XJ

The following example PeekMessage request returns the message associated with the message ID specified.

ErrorDescription
MissingParameter MessageId parameter was not present in the request.
MessageNotFoundNo message exists with the MessageId specified.
InvalidURIThe URL for the queue is not valid or was not a URL returned by a CreateQueue or ListQueues request.