ISQSReceiveMessageRequest
Interface in AWS.SQS
Interface for ReceiveMessage requests.
Ancestors
Properties
AttributeNames
property AttributeNames: TList<string>
A collection of system attribute names to be returned with each message.
These attributes provide metadata about messages and queues. Specify All to return all available system attributes, or specify individual attribute names to retrieve only specific metadata. Message-specific system attributes:
SenderId– The AWS account number (for IAM users) or the IP address (for anonymous users) of the senderSentTimestamp– The time when the message was sent to the queue (epoch time in milliseconds)ApproximateReceiveCount– The number of times a message has been received from the queue but not deletedApproximateFirstReceiveTimestamp– The time when the message was first received from the queue (epoch time in milliseconds) FIFO queue specific attributes:SequenceNumber– The large, non-consecutive number assigned to each message in FIFO queuesMessageDeduplicationId– The token used for deduplication of messages within the deduplication intervalMessageGroupId– The tag that specifies that messages belong to a specific message group Tracing and monitoring attributes:AWSTraceHeader– The AWS X-Ray trace header string for distributed tracing Dead letter queue attributes:DeadLetterQueueSourceArn– The ARN of the source queue when the message was moved from a dead letter queue Timestamp attributes are returned as strings representing epoch time in milliseconds. Use these values to calculate message age, processing delays, and retry patterns. Requesting specific attributes instead ofAllcan improve performance and reduce response payload size when you only need certain metadata. System attributes are automatically generated by Amazon SQS and cannot be modified by users. They provide essential information for message processing, monitoring, and troubleshooting.
MaxNumberOfMessages
property MaxNumberOfMessages: TOptional<Integer>
The maximum number of messages to return.
Valid values: 1 to 10 messages. Default: 1. Amazon SQS never returns more messages than this value, however fewer messages might be returned depending on the number of messages available in the queue and the queue's configuration. If the number of messages in the queue is small (fewer than 1,000), you most likely will get fewer messages than requested per receive call.
MessageAttributeNames
property MessageAttributeNames: TList<string>
A collection of message attribute names to be returned with each message.
Message attributes are custom metadata attached to messages by the sender. Specify All or .* to return all message attributes, or specify individual attribute names. You can use wildcard patterns such as prefix.* to return all attributes that start with a specific prefix. Message attribute names are case-sensitive and must be unique among all attributes for the message. Attribute names can contain alphanumeric characters, hyphens (-), underscores (_), and periods (.), but cannot start with AWS-reserved prefixes like AWS. or Amazon..
MessageSystemAttributeNames
property MessageSystemAttributeNames: TList<string>
A collection of message system attribute names to be returned with each message.
Message system attributes are specific metadata fields that provide additional information about message processing and routing. These are distinct from the general system attributes returned by AttributeNames. Currently supported message system attributes:
AWSTraceHeader– The AWS X-Ray trace header string for distributed tracing across services Message system attributes are used for specialized scenarios such as:- Distributed tracing to track message flow across multiple services
- Cross-service correlation for debugging and monitoring
- Integration with AWS X-Ray for end-to-end request tracking
Unlike regular message attributes which are set by the sender, message system attributes are managed by AWS services and provide infrastructure-level metadata. Specify
Allto return all available message system attributes, or specify individual attribute names to retrieve only specific system metadata. These attributes are separate from both user-defined message attributes (retrieved viaMessageAttributeNames) and general system attributes (retrieved viaAttributeNames).
ReceiveRequestAttemptId
property ReceiveRequestAttemptId: string
The token used for deduplication of ReceiveMessage calls.
This parameter applies only to FIFO (first-in-first-out) queues. If a networking issue occurs after a ReceiveMessage action and you receive a generic error instead of a response, you can 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. If you don't provide this value for FIFO queues, Amazon SQS generates one automatically. This parameter enables exactly-once receive semantics for FIFO queues when network issues occur.
VisibilityTimeout
property VisibilityTimeout: TOptional<Integer>
The duration in seconds that the received messages are hidden from subsequent retrieve requests.
Valid range: 0 to 43200 seconds (12 hours). If not specified, the queue's default VisibilityTimeout value is used. This parameter is applied to the messages that Amazon SQS returns in the response. Messages become visible again if they are not deleted before the visibility timeout expires. Setting this to 0 makes the messages immediately available for other consumers to receive again.
WaitTimeSeconds
property WaitTimeSeconds: TOptional<Integer>
The duration in seconds for which the call waits for a message to arrive before returning.
Valid range: 0 to 20 seconds. Default: 0 (short polling). If a message is available, the call returns sooner than WaitTimeSeconds. If no messages are available and the wait time expires, the call returns successfully with an empty list. Using long polling (values greater than 0) reduces the number of empty responses and can significantly reduce costs. Long polling also helps reduce false empty responses. To avoid HTTP errors, ensure that the HTTP response timeout for ReceiveMessage requests is longer than the WaitTimeSeconds parameter.
Methods
AddAttributeName
function AddAttributeName(const AAttributeName: string): NativeInt;
Add an attribute name to AttributeNames.
Parameters
| Name | Description |
|---|---|
AAttributeName | Specify an attribute name to add to AttributeNames. |
Returns
Returns the index of the attribute name added to AttributeNames.
AddMessageAttributeName
function AddMessageAttributeName( const AMessageAttributeName: string): NativeInt;
Add a message attribute name to MessageAttributeNames.
Parameters
| Name | Description |
|---|---|
AAttributeName | Specify a message attribute name to add to MessageAttributeNames. |
Returns
Returns the index of the message attribute name added to MessageAttributeNames.
AddMessageSystemAttributeName
function AddMessageSystemAttributeName( const AMessageSystemAttributeName: string): NativeInt;
Add a message system attribute name to MessageSystemAttributeNames.
Parameters
| Name | Description |
|---|---|
AAttributeName | Specify a message system attribute name to add to MessageSystemAttributeNames. |
Returns
Returns the index of the message system attribute name added to MessageSystemAttributeNames.