One message fails in a ten-message Lambda batch. What should happen to the other nine?
After this you can answer: One message fails in a ten-message Lambda batch. What should happen to the other nine?
Say it in 30 seconds
Section titled “Say it in 30 seconds”The deeper answer
Section titled “The deeper answer”The email and ticket handlers process records sequentially and collect failures. Bad JSON, unsupported payloads and downstream service errors are failures for that record; they do not stop the loop from attempting the others.
The returned identifiers are the SQS record IDs, not the application booking IDs. Lambda needs the transport identifiers to decide which received messages to retain. A successful duplicate is omitted from the failure list so it can be deleted.
Partial reporting reduces repeated work but does not isolate execution time. The batch still shares one Lambda invocation timeout. A slow first record can consume time needed by later records, and a timeout prevents the function from returning its final failure list. In production I would tune batch size against worst-case processing time and downstream capacity, then watch duration, retries and queue age together.
Counter-questions
Section titled “Counter-questions”What if ReportBatchItemFailures is missing?
Why catch validation errors?
Would parallel processing improve throughput?
Where in MiniTickets
Section titled “Where in MiniTickets”Read Lambda worker, then inspect the worker-lambda piece →.
apps/worker/src/batch.ts → handleBatchRead this book online: https://book.theversehub.in/