SQS DeleteMessage - ReceiptHandleIsInvalid - Node-red-contrib-aws

When I try to delete a message from an AWS SQS queue with module node-red-contrib-aws, I can not figure out how to set the ReceiptHandle from parameter. When I set it as a fixed string, it works and deletes the message, but since every message, or actually every fetch of an message, has its own ReceiptHandler that shall be used to delete the message.

Quite new on Node-Red, so maybe it is some obvious I missing, but I can not figure out how the msg object should look like or what to write in the hilited box.

Any clue, anyone?


The node-red-contrib-aws nodes are just a fairly raw wrapper around the AWS JS SDK, as such they take the parameters in the same method as the SDK functions.

So in this case you would set the RecieptHandle as msg.payload.ReceiptHandle (it might be msg.ReceiptHandle I can't remeber exactly)

There's an example flow included with the nodes that might help, goto the top left menu in NodeRED, then Import and select Examples, then the node-red-contrib-aws folder

Excellent. So it was so simple.
Just transform the msg object in a function
msg.ReceiptHandle = msg.payload.Messages[0].ReceiptHandle;
and leave "ReceiptHandle" box empty, and it works!

Thank you!

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.