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.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/cdk-kinesis-poison-pill

Deploy

make deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

make destroy

Created by:

Benjamen Pyle

Benjamen Pyle

Benjamen Pyle is an AWS Community Builder who loves building scalable and useful applications with Serverless and Event Driven Architectures

Follow on LinkedIn