Home > front end >  What messageIds should be added to the BatchItemFailures when processing SQSEvent from a FIFO-queue
What messageIds should be added to the BatchItemFailures when processing SQSEvent from a FIFO-queue

Time:05-10

According to https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-batchfailurereporting they recommend to not process more records if you fail to process a record because it will preserve the order of the messages in an FIFO queue.

But does that mean I should add all subsequent MessageIds (the ones Im skipping) to the BatchItemFailures-collection?

CodePudding user response:

Yes, if you are skipping any messages, you should return their IDs. Any messages passed into your function that you did not successfully processed should be returned in BatchItemFailures.

AWS doesn't know that you wrote some code in your Lambda function to skip those messages. They are just making a recommendation that you write that code. The only way AWS knows you didn't successfully process those messages is if your function returns all those IDs you didn't process.

  • Related