Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

SeekerWing
Copy link
Contributor

fixes #11722


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Nov 26, 2020

Copy link
Contributor

@nija-at nija-at left a 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.

@nija-at nija-at changed the title feat(aws-lambda-event-sources): add support for batching window to sqs event source feat(lambda-event-sources): add support for batching window to sqs event source Nov 30, 2020
@nija-at nija-at changed the title feat(lambda-event-sources): add support for batching window to sqs event source feat(lambda-event-sources): batching window for sqs event source Nov 30, 2020
@mergify mergify bot dismissed nija-at’s stale review December 19, 2020 14:24

Pull request has been modified.

@SeekerWing SeekerWing requested a review from nija-at December 19, 2020 14:28
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 992fe2c
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@nija-at nija-at left a 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)
Copy link
Contributor

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 -

Suggested change
* @default Duration.seconds(0)
* @default - no batching window. The lambda function will be invoked immediately with the records that are available.

Comment on lines +47 to +48
if (maxBatchingWindow.toSeconds() < 0 || maxBatchingWindow.toSeconds() > 300) {
throw new Error(`Maximum batching window must be between 0 and 300 seconds (given ${maxBatchingWindow.toSeconds()})`);
Copy link
Contributor

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.

Suggested change
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let batchSize : number;
const batchSize: number = 500;

@cbenning
Copy link

What is the status on this making it into CDK? my team is waiting on this new feature.

@nija-at
Copy link
Contributor

nija-at commented Feb 18, 2021

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.

mergify bot pushed a commit that referenced this pull request Mar 26, 2021
…source (#13406)

Fixes #11722

This is continued work from #11724

closes #13770

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Mar 31, 2021
…source (aws#13406)

Fixes aws#11722

This is continued work from aws#11724

closes aws#13770

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@SeekerWing
Copy link
Contributor Author

closing this PR in favor of #13406

@SeekerWing SeekerWing closed this Jun 9, 2021
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
…source (aws#13406)

Fixes aws#11722

This is continued work from aws#11724

closes aws#13770

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-lambda-event-sources): add batching window support for SQS event sources
5 participants