I have a AWS lambda function written in javascript using the node12 runtime. If I fail to process the message given in the sqs event, how do I tell the queue that I was unable to process the message and to leave the message in the queue?
Does it require an http response with status code like 200
for success or 500
for failure, or does the lambda need to throw an error to signal that it didn't process.
I can't find what response is expected in an sqs event handler function. What is the handler expected to return?
async function handler(event) {
try {
const body = event.Records[0].body;
// do some process
// what do I return if successful
} catch (err) {
// what do I return if my process wasn't successful
}
}