SQS Reject Message

Rejects a message and returns it to SQS queue

Overview

This node rejects a message in an AWS SQS queue by changing its visibility timeout, effectively returning the message to the queue for reprocessing. It is useful in scenarios where a message processing fails and needs to be retried immediately or after a delay. For example, if a workflow encounters an error processing a message, this node can be used to make the message available again in the queue for another attempt.

Use Case Examples

  1. Retrying failed message processing by setting visibility timeout to 0 to make the message immediately available again.
  2. Delaying message reprocessing by setting a custom visibility timeout value.

Properties

Name Meaning
Queue URL The URL of the SQS queue where the message resides.
Receipt Handle The receipt handle of the message to reject, used to identify the message in the queue.
Visibility Timeout The duration (in seconds) to hide the message from other consumers. Set to 0 to make the message immediately available again.

Output

JSON

  • rejected - Boolean indicating if the message was successfully rejected.
  • success - Boolean indicating if the operation succeeded.
  • returnedToQueue - Boolean indicating if the message was returned to the queue immediately (visibility timeout is 0).
  • error - Error message if the rejection failed.

Dependencies

  • AWS SDK for JavaScript v3 (specifically @aws-sdk/client-sqs)

Troubleshooting

  • Ensure AWS credentials (access key ID and secret access key) are correctly configured and have permissions to change message visibility in the specified SQS queue.
  • Verify that the Queue URL and Receipt Handle are correct and correspond to the message intended to be rejected.
  • Common error messages include permission denied errors or invalid receipt handle errors. Check AWS IAM policies and message receipt handle validity to resolve these.

Links

Discussion