Exams / DVA-C02 / Streaming data with Kinesis / Question 2
DVA-C02 practice question: Streaming data with Kinesis (2 of 2)
Development with AWS Services A free question from our original DVA-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.
A Lambda function processes an Amazon Kinesis data stream through an event source mapping with default settings. One malformed record makes the function throw an error, and processing of that shard has stopped while Lambda keeps retrying the same batch. The developer wants good records to keep flowing and failed records to be recorded for later review. Which TWO changes should the developer make to the event source mapping? (Choose two.)
Choose two answers.
- AA. Turn on the setting that splits a failed batch in two before retrying.
- BB. Set a maximum retry count and an on-failure destination such as an Amazon SQS queue.
- CC. Configure a dead-letter queue in the function's asynchronous invocation settings.
- DD. Increase the visibility timeout on the stream to give the function more time.
- EE. Add more shards to the stream so that the failing shard receives fewer records.
Show the answer and explanation
Answers: A, B
- A. Right: Correct. BisectBatchOnFunctionError keeps splitting the batch, which isolates the bad record so the good ones are processed.
- B. Right: Correct. After the retries are used up, Lambda sends details of the failed records to the destination and moves on with the shard.
- C. Wrong: The asynchronous DLQ applies to asynchronous invocations. Stream event source mappings use their own on-failure destination.
- D. Wrong: Visibility timeout is an Amazon SQS setting. Kinesis streams have no such setting.
- E. Wrong: Resharding does not remove the poison record. The shard that holds it stays blocked.
Explanation
Lambda processes each shard in order, so with default settings a failing record can block its shard until the data expires. Bisecting batches isolates bad records, and a retry limit (or maximum record age) plus an on-failure destination lets Lambda skip the record while keeping a record of the failure.
Study
Keep practising
Answer questions with a score at the end, or practise just this topic with the explanation after each one. No sign-up needed.