Search code examples
amazon-web-servicesaws-lambdaamazon-sqsaws-sqs-fifo

In SQS + Lambda, can I write the distributed processing logic of Lambda internal poller that reads messages from SQS?


I am currently using SQS(fifo) + Lambda trigger architecture. Whenever a message is issued to SQS, a Lambda function is created and processed by the internal poller.

This is perfectly normal, typical SQS + Lambda processing logic. But I want to limit the maximum number of Lambdas created per second. No matter how hundreds of thousands of messages are delivered to SQS, the Lambda internal poller rate-limits these messages to create a Lambda function, and I want to write this rate limiting logic myself.

Is it possible? If possible, I would appreciate it if you could leave any related materials! Also, if you have a better recommended architecture than SQS + Lambda, please share!


Solution

  • But I want to limit the maximum number of Lambdas created per second.

    You do this by setting concurrency limit of your lambda. If you only want one function, set it to 1.

    and I want to write this rate limiting logic myself.

    You can't change internal logic of a lambda's SQS pooler.