Handling an Amazon Kinesis Poison Pill with an AWS Lambda Consumer
Kinesis → Lambda
Handle Kinesis Data Stream consumer failures to keep iterators healthy, retry recoverable errors, and abandon bad messages.
This pattern demonstrates how to handle a Lambda consumer failure when reading from a Kinesis Data Stream with CDK. Without proper handling of failure when working with Kinesis Data Streams, an iterator will get stuck and the only way for the data to clear the stream is for it to **Age Out** beyond the trim horizon. By leveraging OnFailure triggers when using CDK's KinesisEventSource, Lambda consumers will be more resiliant, less wasteful and allow downstreawm consumers to get events in the most timely manner possible.