如何将AWS SQS与AWS Lambda合并 [英] How to pool AWS SQS with AWS Lambda

查看:218
本文介绍了如何将AWS SQS与AWS Lambda合并的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此刻,我正在从后端池化AWS SQS,并在收到有效负载后进行业务逻辑.

At the moment I'm are pooling AWS SQS from our back-end and doing business logic once payload is received.

我想将其移至AWS Lambda并开始通过SQS/SNS自动化业务逻辑.

I would like to move this to AWS Lambda and start automating business logic via SQS/SNS.

由于我无法订阅AWS SQS事件,因此在Lambda(node.js)中实现SQS池的最佳实践是什么?

As I can not subscribe to AWS SQS events, what is the best practice in implementing SQS pooling with Lambda (node.js)?

推荐答案

通过使用内置的Lambda SQS事件源,甚至可以简化整个轮询过程.

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

Lambda将自动横向扩展以消耗消息 在我的队列中. Lambda将尝试尽快消耗队列,并且 通过最大限度地提高并发范围内的并发效率 每项服务.随着队列流量的波动,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.

请参见 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆