How to pool AWS SQS with AWS Lambda

ぐ巨炮叔叔 提交于 2019-12-06 05:22:19

SQS doesn't really work well with Lambda since you cannot automatically trigger Lambda functions from SQS queues messages.

I would rather remove the SQS/SNS logic and go for a DynamoDB Streams based solution that would cover the queueing, archiving & Lambda triggering tasks natively: your producer puts messages in a DynamoDB table while your Lambda is triggered for any new entry with Streams (it's an AWS native mechanism)

Of course a Kinesis based solution may be considered as well.

It is possible to even simplify the whole polling process by using the built-in SQS event source for lambda.

Lambda will automatically scale out horizontally consume the messages in my queue. Lambda will try to consume the queue as quickly and effeciently as possible by maximizing concurrency within the bounds of each service. As the queue traffic fluctuates the Lambda service will scale the polling operations up and down based on the number of inflight messages.

see AWS Blog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!