Hi folks
I am trying to use partial batch failure handling on a lambda in conjunction with a dynamodbstream. For testing purposes, I am trying to set up a lambda that reports a itemFailure for every third record received via the dynamodbstream (batch size 100). I am struggling to make this work. The lambda does return an object: {“batchItemFailures”: [{itemIdentifier: “03f893b2”}]} (example).
I have configured the eventSource mapping with FunctionResponseTypes: [“ReportBatchItemFailures”] and a DestinationConfig: { OnFailure: { Destination: dlqArn}}
I would like to ask if anybody has got this to work? I am wondering if this is not yet implemented or I have made a mistake in the configuration. I did find a PR for SQS PartialBatchItemFailures, but I do not know if this also includes dynamodbstreams.
Thank you for reporting this issue. We are aware of several issues related to Lambda Event Source Mappings and I can confirm that we are lacking test coverage for your specific scenario.
We are working on a complete rewrite of the Lambda Event Source Mapping with better AWS parity, performance, and test coverage. Most tests are already passing and partial batch failure handling has been carefully considered during the re-design. You will soon be able to opt into the new implementation (ETA: in the coming weeks). Stay tuned
PS: Partial batch failure handling is supported for EventBridge Pipes
Batch failure handling (i.e., ReportBatchItemFailures) is one of the big improvements with our new Lambda event source mapping implementation. We encourage you to give it another try and are looking forward to hearing your feedback .
Check out our new Lambda event source mapping (ESM) implementation in LocalStack v4 offering better functional and non-functional support for ESM . The behavioral coverage documentation provides more details for your use case Lambda | Docs
Feel free to create a GitHub issue or share your feedback if you experience any challenges👂