AWS SDK for C++

AWS SDK for C++ Version 1.11.892

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Aws::SQS::Model::ReceiveMessageRequest Class Reference

#include <ReceiveMessageRequest.h>

Inheritance diagram for Aws::SQS::Model::ReceiveMessageRequest:
[legend]

Public Member Functions

AWS_SQS_API ReceiveMessageRequest ()=default
 
virtual const char * GetServiceRequestName () const override
 
virtual bool IsLongPollingOperation () const override
 
AWS_SQS_API Aws::String SerializePayload () const override
 
 
const Aws::StringGetQueueUrl () const
 
bool QueueUrlHasBeenSet () const
 
template<typename QueueUrlT = Aws::String>
void SetQueueUrl (QueueUrlT &&value)
 
template<typename QueueUrlT = Aws::String>
ReceiveMessageRequestWithQueueUrl (QueueUrlT &&value)
 
 
 
template<typename MessageSystemAttributeNamesT = Aws::Vector<MessageSystemAttributeName>>
void SetMessageSystemAttributeNames (MessageSystemAttributeNamesT &&value)
 
template<typename MessageSystemAttributeNamesT = Aws::Vector<MessageSystemAttributeName>>
ReceiveMessageRequestWithMessageSystemAttributeNames (MessageSystemAttributeNamesT &&value)
 
 
 
 
template<typename MessageAttributeNamesT = Aws::Vector<Aws::String>>
void SetMessageAttributeNames (MessageAttributeNamesT &&value)
 
template<typename MessageAttributeNamesT = Aws::Vector<Aws::String>>
ReceiveMessageRequestWithMessageAttributeNames (MessageAttributeNamesT &&value)
 
template<typename MessageAttributeNamesT = Aws::String>
ReceiveMessageRequestAddMessageAttributeNames (MessageAttributeNamesT &&value)
 
 
 
void SetMaxNumberOfMessages (int value)
 
 
int GetVisibilityTimeout () const
 
 
void SetVisibilityTimeout (int value)
 
 
int GetWaitTimeSeconds () const
 
 
void SetWaitTimeSeconds (int value)
 
 
 
 
template<typename ReceiveRequestAttemptIdT = Aws::String>
void SetReceiveRequestAttemptId (ReceiveRequestAttemptIdT &&value)
 
template<typename ReceiveRequestAttemptIdT = Aws::String>
ReceiveMessageRequestWithReceiveRequestAttemptId (ReceiveRequestAttemptIdT &&value)
 

Public Member Functions inherited from Aws::SQS::SQSRequest

virtual ~SQSRequest ()
 
 
 

Public Member Functions inherited from Aws::AmazonSerializableWebServiceRequest

 
 
std::shared_ptr< Aws::IOStreamGetBody () const override
 

Public Member Functions inherited from Aws::AmazonWebServiceRequest

 
virtual ~AmazonWebServiceRequest ()=default
 
 
virtual void SetAdditionalCustomHeaderValue (const Aws::String &headerName, const Aws::String &headerValue)
 
virtual void AddQueryStringParameters (Aws::Http::URI &uri) const
 
virtual void PutToPresignedUrl (Aws::Http::URI &uri) const
 
virtual bool IsStreaming () const
 
virtual bool IsEventStreamRequest () const
 
virtual bool HasEventStreamResponse () const
 
virtual bool SignBody () const
 
virtual bool HasEmbeddedError (Aws::IOStream &body, const Aws::Http::HeaderValueCollection &header) const
 
virtual bool IsChunked () const
 
virtual void SetRequestSignedHandler (const RequestSignedHandler &handler)
 
 
 
 
 
 
 
 
 
virtual bool ShouldComputeContentMd5 () const
 
virtual bool ShouldValidateResponseChecksum () const
 
 
 
virtual void SetServiceSpecificParameters (const std::shared_ptr< Http::ServiceSpecificParameters > &serviceSpecificParameters) const
 
 
 
 
 
 
virtual bool RequestChecksumRequired () const
 
 
void SetRetryContext (const RetryContext &context) const
 
 
virtual bool ChecksumAlgorithmIsSet () const
 
virtual void SetHeadersReceivedEventHandler (const Aws::Http::HeadersReceivedEventHandler &headersReceivedEventHandler)
 
virtual void SetHeadersReceivedEventHandler (Aws::Http::HeadersReceivedEventHandler &&headersReceivedEventHandler)
 
virtual void SetDataReceivedEventHandler (const Aws::Http::DataReceivedEventHandler &dataReceivedEventHandler)
 
virtual void SetDataReceivedEventHandler (Aws::Http::DataReceivedEventHandler &&dataReceivedEventHandler)
 
virtual void SetDataSentEventHandler (const Aws::Http::DataSentEventHandler &dataSentEventHandler)
 
virtual void SetDataSentEventHandler (Aws::Http::DataSentEventHandler &&dataSentEventHandler)
 
virtual void SetContinueRequestHandler (const Aws::Http::ContinueRequestHandler &continueRequestHandler)
 
virtual void SetContinueRequestHandler (Aws::Http::ContinueRequestHandler &&continueRequestHandler)
 
virtual void SetRequestRetryHandler (const RequestRetryHandler &handler)
 
 
virtual void SetHeadersReceivedEventHandler (const Aws::Http::HeadersReceivedEventHandler &headersReceivedEventHandler)
 
virtual void SetHeadersReceivedEventHandler (Aws::Http::HeadersReceivedEventHandler &&headersReceivedEventHandler)
 
virtual void SetDataReceivedEventHandler (const Aws::Http::DataReceivedEventHandler &dataReceivedEventHandler)
 
virtual void SetDataReceivedEventHandler (Aws::Http::DataReceivedEventHandler &&dataReceivedEventHandler)
 
virtual void SetDataSentEventHandler (const Aws::Http::DataSentEventHandler &dataSentEventHandler)
 
virtual void SetDataSentEventHandler (Aws::Http::DataSentEventHandler &&dataSentEventHandler)
 
virtual void SetContinueRequestHandler (const Aws::Http::ContinueRequestHandler &continueRequestHandler)
 
virtual void SetContinueRequestHandler (Aws::Http::ContinueRequestHandler &&continueRequestHandler)
 
virtual void SetRequestRetryHandler (const RequestRetryHandler &handler)
 
 

Additional Inherited Members

Public Types inherited from Aws::SQS::SQSRequest

 
 

Public Types inherited from Aws::AmazonWebServiceRequest

 

Protected Member Functions inherited from Aws::AmazonWebServiceRequest

virtual void DumpBodyToUrl (Aws::Http::URI &uri) const
 

Protected Attributes inherited from Aws::AmazonWebServiceRequest

 

Detailed Description

Retrieves one or more messages from a specified queue.

See Also:

AWS API Reference

Definition at line 25 of file ReceiveMessageRequest.h.

Constructor & Destructor Documentation

◆ ReceiveMessageRequest()

AWS_SQS_API Aws::SQS::Model::ReceiveMessageRequest::ReceiveMessageRequest ( )
default

Member Function Documentation

◆ AddMessageAttributeNames()

template<typename MessageAttributeNamesT = Aws::String>
ReceiveMessageRequest & Aws::SQS::Model::ReceiveMessageRequest::AddMessageAttributeNames ( MessageAttributeNamesT &&  value)
inline

The name of the message attribute, where N is the index.

  • The name can contain alphanumeric characters and the underscore (_), hyphen (-), and period (.).

  • The name is case-sensitive and must be unique among all attribute names for the message.

  • The name must not start with AWS-reserved prefixes such as AWS. or Amazon. (or any casing variants).

  • The name must not start or end with a period (.), and it should not have periods in succession (..).

  • The name can be up to 256 characters long.

When using ReceiveMessage, you can send a list of attribute names to receive, or you can return all of the attributes by specifying All or .* in your request. You can also use all message attributes starting with a prefix, for example bar.*.

Definition at line 138 of file ReceiveMessageRequest.h.

◆ AddMessageSystemAttributeNames()

ReceiveMessageRequest & Aws::SQS::Model::ReceiveMessageRequest::AddMessageSystemAttributeNames ( MessageSystemAttributeName  value)
inline

A list of attributes that need to be returned along with each message. These attributes include:

  • All – Returns all values.

  • ApproximateFirstReceiveTimestamp – Returns the time the message was first received from the queue (epoch time in milliseconds).

  • ApproximateReceiveCount – Returns the number of times a message has been received across all queues but not deleted.

  • AWSTraceHeader – Returns the X-Ray trace header string.

  • SenderId

    • For a user, returns the user ID, for example ABCDEFGHI1JKLMNOPQ23R.

    • For an IAM role, returns the IAM role ID, for example ABCDE1F2GH3I4JK5LMNOP:i-a123b456.

  • SentTimestamp – Returns the time the message was sent to the queue (epoch time in milliseconds).

  • SqsManagedSseEnabled – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, SSE-KMS or SSE-SQS).

  • MessageDeduplicationId – Returns the value provided by the producer that calls the SendMessage action.

  • MessageGroupId – Returns the value provided by the producer that calls the SendMessage action.

  • SequenceNumber – Returns the value provided by Amazon SQS.

Definition at line 101 of file ReceiveMessageRequest.h.

◆ GetMaxNumberOfMessages()

int Aws::SQS::Model::ReceiveMessageRequest::GetMaxNumberOfMessages ( ) const
inline

The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.

Definition at line 151 of file ReceiveMessageRequest.h.

◆ GetMessageAttributeNames()

const Aws::Vector< Aws::String > & Aws::SQS::Model::ReceiveMessageRequest::GetMessageAttributeNames ( ) const
inline

The name of the message attribute, where N is the index.

  • The name can contain alphanumeric characters and the underscore (_), hyphen (-), and period (.).

  • The name is case-sensitive and must be unique among all attribute names for the message.

  • The name must not start with AWS-reserved prefixes such as AWS. or Amazon. (or any casing variants).

  • The name must not start or end with a period (.), and it should not have periods in succession (..).

  • The name can be up to 256 characters long.

When using ReceiveMessage, you can send a list of attribute names to receive, or you can return all of the attributes by specifying All or .* in your request. You can also use all message attributes starting with a prefix, for example bar.*.

Definition at line 125 of file ReceiveMessageRequest.h.

◆ GetMessageSystemAttributeNames()

const Aws::Vector< MessageSystemAttributeName > & Aws::SQS::Model::ReceiveMessageRequest::GetMessageSystemAttributeNames ( ) const
inline

A list of attributes that need to be returned along with each message. These attributes include:

  • All – Returns all values.

  • ApproximateFirstReceiveTimestamp – Returns the time the message was first received from the queue (epoch time in milliseconds).

  • ApproximateReceiveCount – Returns the number of times a message has been received across all queues but not deleted.

  • AWSTraceHeader – Returns the X-Ray trace header string.

  • SenderId

    • For a user, returns the user ID, for example ABCDEFGHI1JKLMNOPQ23R.

    • For an IAM role, returns the IAM role ID, for example ABCDE1F2GH3I4JK5LMNOP:i-a123b456.

  • SentTimestamp – Returns the time the message was sent to the queue (epoch time in milliseconds).

  • SqsManagedSseEnabled – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, SSE-KMS or SSE-SQS).

  • MessageDeduplicationId – Returns the value provided by the producer that calls the SendMessage action.

  • MessageGroupId – Returns the value provided by the producer that calls the SendMessage action.

  • SequenceNumber – Returns the value provided by Amazon SQS.

Definition at line 89 of file ReceiveMessageRequest.h.

◆ GetQueueUrl()

const Aws::String & Aws::SQS::Model::ReceiveMessageRequest::GetQueueUrl ( ) const
inline

The URL of the Amazon SQS queue from which messages are received.

Queue URLs and names are case-sensitive.

Definition at line 45 of file ReceiveMessageRequest.h.

◆ GetReceiveRequestAttemptId()

const Aws::String & Aws::SQS::Model::ReceiveMessageRequest::GetReceiveRequestAttemptId ( ) const
inline

This parameter applies only to FIFO (first-in-first-out) queues.

The token used for deduplication of ReceiveMessage calls. If a networking issue occurs after a ReceiveMessage action, and instead of a response you receive a generic error, it is possible to retry the same action with an identical ReceiveRequestAttemptId to retrieve the same set of messages, even if their visibility timeout has not yet expired.

  • You can use ReceiveRequestAttemptId only for 5 minutes after a ReceiveMessage action.

  • When you set FifoQueue, a caller of the ReceiveMessage action can provide a ReceiveRequestAttemptId explicitly.

  • It is possible to retry the ReceiveMessage action with the same ReceiveRequestAttemptId if none of the messages have been modified (deleted or had their visibility changes).

  • During a visibility timeout, subsequent calls with the same ReceiveRequestAttemptId return the same messages and receipt handles. If a retry occurs within the deduplication interval, it resets the visibility timeout. For more information, see Visibility Timeout in the Amazon SQS Developer Guide.

    If a caller of the ReceiveMessage action still processes messages when the visibility timeout expires and messages become visible, another worker consuming from the same queue can receive the same messages and therefore process duplicates. Also, if a consumer whose message processing time is longer than the visibility timeout tries to delete the processed messages, the action fails with an error.

    To mitigate this effect, ensure that your application observes a safe threshold before the visibility timeout expires and extend the visibility timeout as necessary.

  • While messages with a particular MessageGroupId are invisible, no more messages belonging to the same MessageGroupId are returned until the visibility timeout expires. You can still receive messages with another MessageGroupId from your FIFO queue as long as they are visible.

  • If a caller of ReceiveMessage can't track the ReceiveRequestAttemptId, no retries work until the original visibility timeout expires. As a result, delays might occur but the messages in the queue remain in a strict order.

The maximum length of ReceiveRequestAttemptId is 128 characters. ReceiveRequestAttemptId can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&amp;'()*+,-./:;&lt;=&gt;?@[]^_`{|}~</code>).</p> <p>For best practices of using <code>ReceiveRequestAttemptId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html">Using the ReceiveRequestAttemptId Request Parameter in the Amazon SQS Developer Guide.

Definition at line 274 of file ReceiveMessageRequest.h.

◆ GetRequestSpecificHeaders()

AWS_SQS_API Aws::Http::HeaderValueCollection Aws::SQS::Model::ReceiveMessageRequest::GetRequestSpecificHeaders ( ) const
overridevirtual

Reimplemented from Aws::SQS::SQSRequest.

◆ GetServiceRequestName()

virtual const char * Aws::SQS::Model::ReceiveMessageRequest::GetServiceRequestName ( ) const
inlineoverridevirtual

Implements Aws::AmazonWebServiceRequest.

Definition at line 33 of file ReceiveMessageRequest.h.

◆ GetVisibilityTimeout()

int Aws::SQS::Model::ReceiveMessageRequest::GetVisibilityTimeout ( ) const
inline

The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.

Understanding VisibilityTimeout:

  • When a message is received from a queue, it becomes temporarily invisible to other consumers for the duration of the visibility timeout. This prevents multiple consumers from processing the same message simultaneously. If the message is not deleted or its visibility timeout is not extended before the timeout expires, it becomes visible again and can be retrieved by other consumers.

  • Setting an appropriate visibility timeout is crucial. If it's too short, the message might become visible again before processing is complete, leading to duplicate processing. If it's too long, it delays the reprocessing of messages if the initial processing fails.

  • You can adjust the visibility timeout using the –visibility-timeout parameter in the receive-message command to match the processing time required by your application.

  • A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the dead-letter queue.

For more information, see Visibility Timeout in the Amazon SQS Developer Guide.

Definition at line 188 of file ReceiveMessageRequest.h.

◆ GetWaitTimeSeconds()

int Aws::SQS::Model::ReceiveMessageRequest::GetWaitTimeSeconds ( ) const
inline

The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than WaitTimeSeconds. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a ReceiveMessageResponse object, which has a empty list instead of a Null object.

To avoid HTTP errors, ensure that the HTTP response timeout for ReceiveMessage requests is longer than the WaitTimeSeconds parameter. For example, with the Java SDK, you can set HTTP transport settings using the NettyNioAsyncHttpClient for asynchronous clients, or the ApacheHttpClient for synchronous clients.

Definition at line 216 of file ReceiveMessageRequest.h.

◆ IsLongPollingOperation()

virtual bool Aws::SQS::Model::ReceiveMessageRequest::IsLongPollingOperation ( ) const
inlineoverridevirtual

Reimplemented from Aws::AmazonWebServiceRequest.

Definition at line 35 of file ReceiveMessageRequest.h.

◆ MaxNumberOfMessagesHasBeenSet()

bool Aws::SQS::Model::ReceiveMessageRequest::MaxNumberOfMessagesHasBeenSet ( ) const
inline

The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.

Definition at line 152 of file ReceiveMessageRequest.h.

◆ MessageAttributeNamesHasBeenSet()

bool Aws::SQS::Model::ReceiveMessageRequest::MessageAttributeNamesHasBeenSet ( ) const
inline

The name of the message attribute, where N is the index.

  • The name can contain alphanumeric characters and the underscore (_), hyphen (-), and period (.).

  • The name is case-sensitive and must be unique among all attribute names for the message.

  • The name must not start with AWS-reserved prefixes such as AWS. or Amazon. (or any casing variants).

  • The name must not start or end with a period (.), and it should not have periods in succession (..).

  • The name can be up to 256 characters long.

When using ReceiveMessage, you can send a list of attribute names to receive, or you can return all of the attributes by specifying All or .* in your request. You can also use all message attributes starting with a prefix, for example bar.*.

Definition at line 126 of file ReceiveMessageRequest.h.

◆ MessageSystemAttributeNamesHasBeenSet()

bool Aws::SQS::Model::ReceiveMessageRequest::MessageSystemAttributeNamesHasBeenSet ( ) const
inline

A list of attributes that need to be returned along with each message. These attributes include:

  • All – Returns all values.

  • ApproximateFirstReceiveTimestamp – Returns the time the message was first received from the queue (epoch time in milliseconds).

  • ApproximateReceiveCount – Returns the number of times a message has been received across all queues but not deleted.

  • AWSTraceHeader – Returns the X-Ray trace header string.

  • SenderId

    • For a user, returns the user ID, for example ABCDEFGHI1JKLMNOPQ23R.

    • For an IAM role, returns the IAM role ID, for example ABCDE1F2GH3I4JK5LMNOP:i-a123b456.

  • SentTimestamp – Returns the time the message was sent to the queue (epoch time in milliseconds).

  • SqsManagedSseEnabled – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, SSE-KMS or SSE-SQS).

  • MessageDeduplicationId – Returns the value provided by the producer that calls the SendMessage action.

  • MessageGroupId – Returns the value provided by the producer that calls the SendMessage action.

  • SequenceNumber – Returns the value provided by Amazon SQS.

Definition at line 90 of file ReceiveMessageRequest.h.

◆ QueueUrlHasBeenSet()

bool Aws::SQS::Model::ReceiveMessageRequest::QueueUrlHasBeenSet ( ) const
inline

The URL of the Amazon SQS queue from which messages are received.

Queue URLs and names are case-sensitive.

Definition at line 46 of file ReceiveMessageRequest.h.

◆ ReceiveRequestAttemptIdHasBeenSet()

bool Aws::SQS::Model::ReceiveMessageRequest::ReceiveRequestAttemptIdHasBeenSet ( ) const
inline

This parameter applies only to FIFO (first-in-first-out) queues.

The token used for deduplication of ReceiveMessage calls. If a networking issue occurs after a ReceiveMessage action, and instead of a response you receive a generic error, it is possible to retry the same action with an identical ReceiveRequestAttemptId to retrieve the same set of messages, even if their visibility timeout has not yet expired.

  • You can use ReceiveRequestAttemptId only for 5 minutes after a ReceiveMessage action.

  • When you set FifoQueue, a caller of the ReceiveMessage action can provide a ReceiveRequestAttemptId explicitly.

  • It is possible to retry the ReceiveMessage action with the same ReceiveRequestAttemptId if none of the messages have been modified (deleted or had their visibility changes).

  • During a visibility timeout, subsequent calls with the same ReceiveRequestAttemptId return the same messages and receipt handles. If a retry occurs within the deduplication interval, it resets the visibility timeout. For more information, see Visibility Timeout in the Amazon SQS Developer Guide.

    If a caller of the ReceiveMessage action still processes messages when the visibility timeout expires and messages become visible, another worker consuming from the same queue can receive the same messages and therefore process duplicates. Also, if a consumer whose message processing time is longer than the visibility timeout tries to delete the processed messages, the action fails with an error.

    To mitigate this effect, ensure that your application observes a safe threshold before the visibility timeout expires and extend the visibility timeout as necessary.

  • While messages with a particular MessageGroupId are invisible, no more messages belonging to the same MessageGroupId are returned until the visibility timeout expires. You can still receive messages with another MessageGroupId from your FIFO queue as long as they are visible.

  • If a caller of ReceiveMessage can't track the ReceiveRequestAttemptId, no retries work until the original visibility timeout expires. As a result, delays might occur but the messages in the queue remain in a strict order.

The maximum length of ReceiveRequestAttemptId is 128 characters. ReceiveRequestAttemptId can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&amp;'()*+,-./:;&lt;=&gt;?@[]^_`{|}~</code>).</p> <p>For best practices of using <code>ReceiveRequestAttemptId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html">Using the ReceiveRequestAttemptId Request Parameter in the Amazon SQS Developer Guide.

Definition at line 275 of file ReceiveMessageRequest.h.

◆ SerializePayload()

AWS_SQS_API Aws::String Aws::SQS::Model::ReceiveMessageRequest::SerializePayload ( ) const
overridevirtual

◆ SetMaxNumberOfMessages()

void Aws::SQS::Model::ReceiveMessageRequest::SetMaxNumberOfMessages ( int  value)
inline

The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.

Definition at line 153 of file ReceiveMessageRequest.h.

◆ SetMessageAttributeNames()

template<typename MessageAttributeNamesT = Aws::Vector<Aws::String>>
void Aws::SQS::Model::ReceiveMessageRequest::SetMessageAttributeNames ( MessageAttributeNamesT &&  value)
inline

The name of the message attribute, where N is the index.

  • The name can contain alphanumeric characters and the underscore (_), hyphen (-), and period (.).

  • The name is case-sensitive and must be unique among all attribute names for the message.

  • The name must not start with AWS-reserved prefixes such as AWS. or Amazon. (or any casing variants).

  • The name must not start or end with a period (.), and it should not have periods in succession (..).

  • The name can be up to 256 characters long.

When using ReceiveMessage, you can send a list of attribute names to receive, or you can return all of the attributes by specifying All or .* in your request. You can also use all message attributes starting with a prefix, for example bar.*.

Definition at line 128 of file ReceiveMessageRequest.h.

◆ SetMessageSystemAttributeNames()

template<typename MessageSystemAttributeNamesT = Aws::Vector<MessageSystemAttributeName>>
void Aws::SQS::Model::ReceiveMessageRequest::SetMessageSystemAttributeNames ( MessageSystemAttributeNamesT &&  value)
inline

A list of attributes that need to be returned along with each message. These attributes include:

  • All – Returns all values.

  • ApproximateFirstReceiveTimestamp – Returns the time the message was first received from the queue (epoch time in milliseconds).

  • ApproximateReceiveCount – Returns the number of times a message has been received across all queues but not deleted.

  • AWSTraceHeader – Returns the X-Ray trace header string.

  • SenderId

    • For a user, returns the user ID, for example ABCDEFGHI1JKLMNOPQ23R.

    • For an IAM role, returns the IAM role ID, for example ABCDE1F2GH3I4JK5LMNOP:i-a123b456.

  • SentTimestamp – Returns the time the message was sent to the queue (epoch time in milliseconds).

  • SqsManagedSseEnabled – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, SSE-KMS or SSE-SQS).

  • MessageDeduplicationId – Returns the value provided by the producer that calls the SendMessage action.

  • MessageGroupId – Returns the value provided by the producer that calls the SendMessage action.

  • SequenceNumber – Returns the value provided by Amazon SQS.

Definition at line 92 of file ReceiveMessageRequest.h.

◆ SetQueueUrl()

template<typename QueueUrlT = Aws::String>
void Aws::SQS::Model::ReceiveMessageRequest::SetQueueUrl ( QueueUrlT &&  value)
inline

The URL of the Amazon SQS queue from which messages are received.

Queue URLs and names are case-sensitive.

Definition at line 48 of file ReceiveMessageRequest.h.

◆ SetReceiveRequestAttemptId()

template<typename ReceiveRequestAttemptIdT = Aws::String>
void Aws::SQS::Model::ReceiveMessageRequest::SetReceiveRequestAttemptId ( ReceiveRequestAttemptIdT &&  value)
inline

This parameter applies only to FIFO (first-in-first-out) queues.

The token used for deduplication of ReceiveMessage calls. If a networking issue occurs after a ReceiveMessage action, and instead of a response you receive a generic error, it is possible to retry the same action with an identical ReceiveRequestAttemptId to retrieve the same set of messages, even if their visibility timeout has not yet expired.

  • You can use ReceiveRequestAttemptId only for 5 minutes after a ReceiveMessage action.

  • When you set FifoQueue, a caller of the ReceiveMessage action can provide a ReceiveRequestAttemptId explicitly.

  • It is possible to retry the ReceiveMessage action with the same ReceiveRequestAttemptId if none of the messages have been modified (deleted or had their visibility changes).

  • During a visibility timeout, subsequent calls with the same ReceiveRequestAttemptId return the same messages and receipt handles. If a retry occurs within the deduplication interval, it resets the visibility timeout. For more information, see Visibility Timeout in the Amazon SQS Developer Guide.

    If a caller of the ReceiveMessage action still processes messages when the visibility timeout expires and messages become visible, another worker consuming from the same queue can receive the same messages and therefore process duplicates. Also, if a consumer whose message processing time is longer than the visibility timeout tries to delete the processed messages, the action fails with an error.

    To mitigate this effect, ensure that your application observes a safe threshold before the visibility timeout expires and extend the visibility timeout as necessary.

  • While messages with a particular MessageGroupId are invisible, no more messages belonging to the same MessageGroupId are returned until the visibility timeout expires. You can still receive messages with another MessageGroupId from your FIFO queue as long as they are visible.

  • If a caller of ReceiveMessage can't track the ReceiveRequestAttemptId, no retries work until the original visibility timeout expires. As a result, delays might occur but the messages in the queue remain in a strict order.

The maximum length of ReceiveRequestAttemptId is 128 characters. ReceiveRequestAttemptId can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&amp;'()*+,-./:;&lt;=&gt;?@[]^_`{|}~</code>).</p> <p>For best practices of using <code>ReceiveRequestAttemptId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html">Using the ReceiveRequestAttemptId Request Parameter in the Amazon SQS Developer Guide.

Definition at line 277 of file ReceiveMessageRequest.h.

◆ SetVisibilityTimeout()

void Aws::SQS::Model::ReceiveMessageRequest::SetVisibilityTimeout ( int  value)
inline

The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.

Understanding VisibilityTimeout:

  • When a message is received from a queue, it becomes temporarily invisible to other consumers for the duration of the visibility timeout. This prevents multiple consumers from processing the same message simultaneously. If the message is not deleted or its visibility timeout is not extended before the timeout expires, it becomes visible again and can be retrieved by other consumers.

  • Setting an appropriate visibility timeout is crucial. If it's too short, the message might become visible again before processing is complete, leading to duplicate processing. If it's too long, it delays the reprocessing of messages if the initial processing fails.

  • You can adjust the visibility timeout using the –visibility-timeout parameter in the receive-message command to match the processing time required by your application.

  • A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the dead-letter queue.

For more information, see Visibility Timeout in the Amazon SQS Developer Guide.

Definition at line 190 of file ReceiveMessageRequest.h.

◆ SetWaitTimeSeconds()

void Aws::SQS::Model::ReceiveMessageRequest::SetWaitTimeSeconds ( int  value)
inline

The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than WaitTimeSeconds. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a ReceiveMessageResponse object, which has a empty list instead of a Null object.

To avoid HTTP errors, ensure that the HTTP response timeout for ReceiveMessage requests is longer than the WaitTimeSeconds parameter. For example, with the Java SDK, you can set HTTP transport settings using the NettyNioAsyncHttpClient for asynchronous clients, or the ApacheHttpClient for synchronous clients.

Definition at line 218 of file ReceiveMessageRequest.h.

◆ VisibilityTimeoutHasBeenSet()

bool Aws::SQS::Model::ReceiveMessageRequest::VisibilityTimeoutHasBeenSet ( ) const
inline

The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.

Understanding VisibilityTimeout:

  • When a message is received from a queue, it becomes temporarily invisible to other consumers for the duration of the visibility timeout. This prevents multiple consumers from processing the same message simultaneously. If the message is not deleted or its visibility timeout is not extended before the timeout expires, it becomes visible again and can be retrieved by other consumers.

  • Setting an appropriate visibility timeout is crucial. If it's too short, the message might become visible again before processing is complete, leading to duplicate processing. If it's too long, it delays the reprocessing of messages if the initial processing fails.

  • You can adjust the visibility timeout using the –visibility-timeout parameter in the receive-message command to match the processing time required by your application.

  • A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the dead-letter queue.

For more information, see Visibility Timeout in the Amazon SQS Developer Guide.

Definition at line 189 of file ReceiveMessageRequest.h.

◆ WaitTimeSecondsHasBeenSet()

bool Aws::SQS::Model::ReceiveMessageRequest::WaitTimeSecondsHasBeenSet ( ) const
inline

The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than WaitTimeSeconds. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a ReceiveMessageResponse object, which has a empty list instead of a Null object.

To avoid HTTP errors, ensure that the HTTP response timeout for ReceiveMessage requests is longer than the WaitTimeSeconds parameter. For example, with the Java SDK, you can set HTTP transport settings using the NettyNioAsyncHttpClient for asynchronous clients, or the ApacheHttpClient for synchronous clients.

Definition at line 217 of file ReceiveMessageRequest.h.

◆ WithMaxNumberOfMessages()

ReceiveMessageRequest & Aws::SQS::Model::ReceiveMessageRequest::WithMaxNumberOfMessages ( int  value)
inline

The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.

Definition at line 157 of file ReceiveMessageRequest.h.

◆ WithMessageAttributeNames()

template<typename MessageAttributeNamesT = Aws::Vector<Aws::String>>
ReceiveMessageRequest & Aws::SQS::Model::ReceiveMessageRequest::WithMessageAttributeNames ( MessageAttributeNamesT &&  value)
inline

The name of the message attribute, where N is the index.

  • The name can contain alphanumeric characters and the underscore (_), hyphen (-), and period (.).

  • The name is case-sensitive and must be unique among all attribute names for the message.

  • The name must not start with AWS-reserved prefixes such as AWS. or Amazon. (or any casing variants).

  • The name must not start or end with a period (.), and it should not have periods in succession (..).

  • The name can be up to 256 characters long.

When using ReceiveMessage, you can send a list of attribute names to receive, or you can return all of the attributes by specifying All or .* in your request. You can also use all message attributes starting with a prefix, for example bar.*.

Definition at line 133 of file ReceiveMessageRequest.h.

◆ WithMessageSystemAttributeNames()

template<typename MessageSystemAttributeNamesT = Aws::Vector<MessageSystemAttributeName>>
ReceiveMessageRequest & Aws::SQS::Model::ReceiveMessageRequest::WithMessageSystemAttributeNames ( MessageSystemAttributeNamesT &&  value)
inline

A list of attributes that need to be returned along with each message. These attributes include:

  • All – Returns all values.

  • ApproximateFirstReceiveTimestamp – Returns the time the message was first received from the queue (epoch time in milliseconds).

  • ApproximateReceiveCount – Returns the number of times a message has been received across all queues but not deleted.

  • AWSTraceHeader – Returns the X-Ray trace header string.

  • SenderId

    • For a user, returns the user ID, for example ABCDEFGHI1JKLMNOPQ23R.

    • For an IAM role, returns the IAM role ID, for example ABCDE1F2GH3I4JK5LMNOP:i-a123b456.

  • SentTimestamp – Returns the time the message was sent to the queue (epoch time in milliseconds).

  • SqsManagedSseEnabled – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, SSE-KMS or SSE-SQS).

  • MessageDeduplicationId – Returns the value provided by the producer that calls the SendMessage action.

  • MessageGroupId – Returns the value provided by the producer that calls the SendMessage action.

  • SequenceNumber – Returns the value provided by Amazon SQS.

Definition at line 97 of file ReceiveMessageRequest.h.

◆ WithQueueUrl()

template<typename QueueUrlT = Aws::String>
ReceiveMessageRequest & Aws::SQS::Model::ReceiveMessageRequest::WithQueueUrl ( QueueUrlT &&  value)
inline

The URL of the Amazon SQS queue from which messages are received.

Queue URLs and names are case-sensitive.

Definition at line 53 of file ReceiveMessageRequest.h.

◆ WithReceiveRequestAttemptId()

template<typename ReceiveRequestAttemptIdT = Aws::String>
ReceiveMessageRequest & Aws::SQS::Model::ReceiveMessageRequest::WithReceiveRequestAttemptId ( ReceiveRequestAttemptIdT &&  value)
inline

This parameter applies only to FIFO (first-in-first-out) queues.

The token used for deduplication of ReceiveMessage calls. If a networking issue occurs after a ReceiveMessage action, and instead of a response you receive a generic error, it is possible to retry the same action with an identical ReceiveRequestAttemptId to retrieve the same set of messages, even if their visibility timeout has not yet expired.

  • You can use ReceiveRequestAttemptId only for 5 minutes after a ReceiveMessage action.

  • When you set FifoQueue, a caller of the ReceiveMessage action can provide a ReceiveRequestAttemptId explicitly.

  • It is possible to retry the ReceiveMessage action with the same ReceiveRequestAttemptId if none of the messages have been modified (deleted or had their visibility changes).

  • During a visibility timeout, subsequent calls with the same ReceiveRequestAttemptId return the same messages and receipt handles. If a retry occurs within the deduplication interval, it resets the visibility timeout. For more information, see Visibility Timeout in the Amazon SQS Developer Guide.

    If a caller of the ReceiveMessage action still processes messages when the visibility timeout expires and messages become visible, another worker consuming from the same queue can receive the same messages and therefore process duplicates. Also, if a consumer whose message processing time is longer than the visibility timeout tries to delete the processed messages, the action fails with an error.

    To mitigate this effect, ensure that your application observes a safe threshold before the visibility timeout expires and extend the visibility timeout as necessary.

  • While messages with a particular MessageGroupId are invisible, no more messages belonging to the same MessageGroupId are returned until the visibility timeout expires. You can still receive messages with another MessageGroupId from your FIFO queue as long as they are visible.

  • If a caller of ReceiveMessage can't track the ReceiveRequestAttemptId, no retries work until the original visibility timeout expires. As a result, delays might occur but the messages in the queue remain in a strict order.

The maximum length of ReceiveRequestAttemptId is 128 characters. ReceiveRequestAttemptId can contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!"#$%&amp;'()*+,-./:;&lt;=&gt;?@[]^_`{|}~</code>).</p> <p>For best practices of using <code>ReceiveRequestAttemptId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html">Using the ReceiveRequestAttemptId Request Parameter in the Amazon SQS Developer Guide.

Definition at line 282 of file ReceiveMessageRequest.h.

◆ WithVisibilityTimeout()

ReceiveMessageRequest & Aws::SQS::Model::ReceiveMessageRequest::WithVisibilityTimeout ( int  value)
inline

The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.

Understanding VisibilityTimeout:

  • When a message is received from a queue, it becomes temporarily invisible to other consumers for the duration of the visibility timeout. This prevents multiple consumers from processing the same message simultaneously. If the message is not deleted or its visibility timeout is not extended before the timeout expires, it becomes visible again and can be retrieved by other consumers.

  • Setting an appropriate visibility timeout is crucial. If it's too short, the message might become visible again before processing is complete, leading to duplicate processing. If it's too long, it delays the reprocessing of messages if the initial processing fails.

  • You can adjust the visibility timeout using the –visibility-timeout parameter in the receive-message command to match the processing time required by your application.

  • A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the dead-letter queue.

For more information, see Visibility Timeout in the Amazon SQS Developer Guide.

Definition at line 194 of file ReceiveMessageRequest.h.

◆ WithWaitTimeSeconds()

ReceiveMessageRequest & Aws::SQS::Model::ReceiveMessageRequest::WithWaitTimeSeconds ( int  value)
inline

The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than WaitTimeSeconds. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a ReceiveMessageResponse object, which has a empty list instead of a Null object.

To avoid HTTP errors, ensure that the HTTP response timeout for ReceiveMessage requests is longer than the WaitTimeSeconds parameter. For example, with the Java SDK, you can set HTTP transport settings using the NettyNioAsyncHttpClient for asynchronous clients, or the ApacheHttpClient for synchronous clients.

Definition at line 222 of file ReceiveMessageRequest.h.


The documentation for this class was generated from the following file: