Actions5
- Message Actions
- Queue Actions
Overview
This node interacts with AWS SQS (Simple Queue Service) to receive messages from a specified SQS queue. It allows users to retrieve messages with configurable options such as the maximum number of messages, visibility timeout, wait time for long polling, and whether to receive all available message attributes. This is useful for workflows that need to process messages from an SQS queue, such as event-driven automation, message processing, or integrating AWS SQS with other systems.
Use Case Examples
- Receive up to 5 messages from an SQS queue named 'my-queue' with a visibility timeout of 60 seconds.
- Use long polling by setting wait time to 10 seconds to reduce empty responses when no messages are available.
- Receive all attributes of messages to get metadata along with the message body.
Properties
| Name | Meaning |
|---|---|
| Queue Name or URL | The name of the SQS queue or the full queue URL from which to receive messages. |
| Max Number of Messages | Maximum number of messages to return in one receive request, between 1 and 10. |
| Visibility Timeout | Duration in seconds that the received messages are hidden from subsequent retrieve requests, between 0 and 43200 seconds. |
| Wait Time Seconds | Duration in seconds to wait for a message to arrive (long polling), between 0 and 20 seconds. |
| Receive All Available Attributes | Boolean flag indicating whether to receive all available message attributes. |
Output
JSON
jsonMessageId- The unique identifier for the received message.ReceiptHandle- The receipt handle associated with the message, used for deleting or changing message visibility.MD5OfBody- MD5 digest of the message body for message integrity verification.Body- The content of the received message.Attributes- Attributes of the message if requested, such as timestamps or custom metadata.
Dependencies
- AWS SDK for JavaScript (v3) - @aws-sdk/client-sqs
Troubleshooting
- Ensure the queue name or URL is correct and the queue exists in the specified AWS region and account. An error 'SQS queue does not exist' indicates a wrong queue name or region.
- Check AWS credentials and permissions to ensure the node has access to receive messages from the specified queue.
- If no messages are returned, verify that the queue contains messages and consider increasing the wait time for long polling to reduce empty responses.
Links
- AWS SQS ReceiveMessage API - Official AWS documentation for the ReceiveMessage API used to receive messages from an SQS queue.