aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.61k stars 1.01k forks source link

feat: maximum_concurrency option in on_sqs_message #2104

Closed adityamohta closed 3 months ago

adityamohta commented 4 months ago

Issue https://github.com/aws/chalice/issues/2031

Description of changes:

This PR adds option to configure MaximumConcurrency value for sqs event source lambdas.

The option can be used like following:

@app.on_sqs_message(queue='my-queue', batch_size=1, maximum_concurrency=20)
def handle_sqs_message(event):
    ...

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

leobarcellos commented 4 months ago

This is really useful.

adityamohta commented 4 months ago

The test failure for python3.8 in ci seem unrelated to this PR.

jamesls commented 4 months ago

Thanks for the pull request.

Yeah those py38 errors should be fixed in https://github.com/aws/chalice/pull/2092, so rebasing from master should fix this. I can take a look at this tomorrow.

adityamohta commented 4 months ago

Yeah those py38 errors should be fixed in #2092, so rebasing from master should fix this. I can take a look at this tomorrow.

Ah, makes sense, thanks for sharing that @jamesls ! 🙇🏻‍♂️

adityamohta commented 3 months ago

I have manually tested the cloudformation, terraform output, and also the chalice deployer (which uses boto). All are working correctly.

@jamesls Thank you for the fix! Rebasing went fine.

Sorry to tag you directly, I understand that reviewing is time consuming, and it would be difficult to find out time for the same. If there is anything I could do to make the process easier let me know, I would be happy to add it here, as well as I will keep that in mind for the future PRs so reviewing is less painful.

Thank you for all the work you are doing to maintain this project. It's class 🙇

jamesls commented 3 months ago

@adityamohta Thanks for updating, appreciate your work on this. Taking a look now.

adityamohta commented 3 months ago

Amazing! Thank you so much for taking out time to review @jamesls 🙇