Created
May 23, 2023 08:54
-
-
Save saswata-dutta/f0c21708df12a04df09642692ad5a15e to your computer and use it in GitHub Desktop.
aws lambda batch item fails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('Loading function'); | |
exports.handler = async (event) => { | |
//console.log('Received event:', JSON.stringify(event, null, 2)); | |
const fails = []; | |
for (const { messageId, body } of event.Records) { | |
console.log('SQS message %s: %j', messageId, body); | |
fails.push(messageId); | |
} | |
// throw new Error('intentional'); | |
return { | |
batchItemFailures: fails.map(i => ({itemIdentifier: i})) | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment