-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(lambda-event-sources): batching window for sqs event source #11724
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting a PR for this change. I've added my comments below.
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this.
This looks ready. Just a couple of comments below to improve error messaging and documentation.
* | ||
* Valid Range: Minimum value of 0 minutes. Maximum value of 5 minutes. | ||
* | ||
* @default Duration.seconds(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to say something like this -
* @default Duration.seconds(0) | |
* @default - no batching window. The lambda function will be invoked immediately with the records that are available. |
if (maxBatchingWindow.toSeconds() < 0 || maxBatchingWindow.toSeconds() > 300) { | ||
throw new Error(`Maximum batching window must be between 0 and 300 seconds (given ${maxBatchingWindow.toSeconds()})`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, it's not possible to construct a Duration
that is less than 0 seconds.
if (maxBatchingWindow.toSeconds() < 0 || maxBatchingWindow.toSeconds() > 300) { | |
throw new Error(`Maximum batching window must be between 0 and 300 seconds (given ${maxBatchingWindow.toSeconds()})`); | |
if (maxBatchingWindow.toSeconds() > 300) { | |
throw new Error(`Maximum batching window must be 300 seconds or less (given ${maxBatchingWindow.toSeconds()})`); |
const stack = new cdk.Stack(); | ||
const fn = new TestFunction(stack, 'Fn'); | ||
const q = new sqs.Queue(stack, 'Q'); | ||
let batchSize : number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let batchSize : number; | |
const batchSize: number = 500; |
What is the status on this making it into CDK? my team is waiting on this new feature. |
Looks like this PR has not been worked on for several months. @cbenning - if you're interested, you could pick this up and get it past the finish line. |
closing this PR in favor of #13406 |
fixes #11722
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license