Posted On: Jan 12, 2023

AWS Lambda now supports setting Maximum Concurrency to the Amazon SQS event source. Maximum Concurrency for SQS as an event source allows customers to control the maximum concurrent invokes by the Amazon SQS event source. When multiple Amazon SQS event sources are configured to a function, customers can control the maximum concurrent invokes of individual SQS event source. 

Lambda makes it easy to consume events from Amazon SQS at scale. A Lambda function subscribes to a SQS queue using an event source mapping (ESM). The ESM consists of processing instances that poll the queue for messages and invoke Lambda function. Processing instances scale up when there are more messages to process, and scale down when they encounter function errors or when the number of messages in the queue drop. 

Previously, customers looking to limit the maximum concurrent invokes by the ESM needed to set a reserved concurrency limit which would limit the concurrency used by the function, but at the cost of less consistent throughput and retrying messages due to function throttling. This new control on the event source mapping directly limits the number of concurrent invokes without having to configure reserved concurrency to perform a similar action. 

You can get started with Maximum Concurrency for Amazon SQS via the AWS Management Console, AWS CLI, AWS SAM, or AWS SDK for Lambda. It can be used at no additional cost in all regions where AWS Lambda is available. For more information on where AWS Lambda is available, see the AWS region table. To learn more about building an Amazon SQS application with Lambda, read the Lambda Developer Guide and the AWS Compute Blog.