A developer is building a serverless application where an AWS Lambda function processes records from an Amazon Kinesis data stream. During testing, some malformed records cause the Lambda function to return an error, which causes the entire batch of records to be retried repeatedly. This retry behavior blocks the stream partition and causes processing latency to increase. The developer wants to configure the event source mapping to automatically split the failed batch and retry the smaller batches to isolate the malformed records. Which configuration change should the developer implement to achieve this goal?
- AIncrease the execution timeout of the Lambda function to allow it to process the entire batch again.
- BDeploy the Lambda function in a private VPC subnet and configure a NAT Gateway to route retry requests.
- Configure the event source mapping with BisectBatchOnFunctionError set to true.Cevap
- DIncrease the visibility timeout of the event source mapping to exceed the Lambda function timeout.
Cevap
Configure the event source mapping with BisectBatchOnFunctionError set to true.
Configuring the event source mapping with BisectBatchOnFunctionError set to true tells Lambda to split a failed batch into two halves and retry them. This process repeats until the problematic record is isolated, allowing the other valid records in the batch to be processed successfully.
Adım Adım Çözüm
Anahtar Kavram
Handling batch processing errors in AWS Lambda event source mappings for stream sources.
Tahmini Süre:1m 30s