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

[SQS] Batch Window #126

Closed
gonzalobertomeu opened this issue Oct 26, 2021 · 4 comments
Closed

[SQS] Batch Window #126

gonzalobertomeu opened this issue Oct 26, 2021 · 4 comments

Comments

@gonzalobertomeu
Copy link

I need to configure maximumBatchingWindow from SQS constructs.
Can you expose this property? Just like batchSize.

@fredericbarthelet
Copy link
Collaborator

fredericbarthelet commented Oct 26, 2021

Hey @gonzalobertomeu, thanks for reporting your problem.
Could you elaborate on the advantages of exposing such configuration feature ? What is your use case for extending batchingWindow ?

In the meantime, you can easily override this property without a dedicated option on the construct using the Resources.extensions property from Serverless framework:

resources:
  extensions:
    MyFunctionEventSourceMapping: // Replace  with the actual logicalId of your event source mapping from cloudformation ressources tab
      Properties:
        MaximumBatchingWindowInSeconds: 150 // Whatever value fits your need

@gonzalobertomeu
Copy link
Author

Hi @fredericbarthelet. Thanks for answer quickly!

In my case, I need to reduce the delay between the arrival of the message and lambda being triggered (with a standard queue).
I set a batch size of 10, but I don't always get a batch of 10 messages and have to wait 60 seconds to fill the batch window (AWS default) for the lambda to trigger.

I am using this in a messaging system (more simmilar to an email than a chat) for an educational platform, in which a message can be delivered to a single person, a family or the entire community of this school (among other categories).
60 seconds of delay its a high value for this case.

Now i'm going to try solution that you provided!

@gonzalobertomeu
Copy link
Author

Screen Shot 2021-10-26 at 16 09 11

Thank you!

@fredericbarthelet
Copy link
Collaborator

Hi @gonzalobertomeu, we recently release a new version of Lift with the introduction of the extensions property. Lift extensions allows developper to override specific pieces of CloudFormation generated by Lift constructs. This would remove the need from your side to manually input generated logicalId by CDK. Would you like to give it a try :) ?

I'm closing this issue in the meantime. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants