sqs-worker-serverless

Example for SQS Worker in AWS Lambda using Serverless

Github星跟踪图

SQS Worker with Serverless ⚡️

MIT License
Read Tutorial

Experimental Serverless Amazon SQS Worker with AWS Lambda.

Update: Please see Serverless Analytics for a more realistic setup using Amazon Kinesis Streams to process your data and events. You can read more about the Kinesis and Lambda connection at Serverless Analytics with Amazon Kinesis and AWS Lambda. This was only intended as an April Fools' project …

Setup

  • SQS Queue with your messages
  • SNS Topic to handle CloudWatch Alarms
  • DynamoDB table to persist configuration
  • CloudWatch Schedule as cron replacement
  • Three (scale, worker, process) AWS Lambda functions

Workflow

  • CloudWatch Alarms on queue length post to SNS
  • SNS Topic triggers scale Lambda function
  • Function scale updates configuration in DynamoDB
  • CloudWatch Schedule invokes worker every x minute(s)
  • Function worker reads configuration from DynamoDB
  • Function worker invokes process function(s)

Auto-Scaling with CloudWatch Alerts

Workers with CloudWatch Schedule

Deploy

$ > yarn install
$ > yarn deploy

Add noise to SQS

You should have some data in your queue to test this setup. Use wrk to send messages to SQS, but make sure to enable anonymous access to sendMessage for your queue first!

$ > wrk -c35 -d60 -t35 \
    -s helpers/wrk.lua \
    https://sqs.REGION.amazonaws.com/ACCOUNT-ID/YourQueueName

主要指标

概览
名称与所有者sbstjn/sqs-worker-serverless
主编程语言JavaScript
编程语言JavaScript (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2017-03-14 21:44:16
推送于2018-07-12 09:45:43
最后一次提交2018-07-12 11:45:42
发布数0
用户参与
星数176
关注者数3
派生数36
提交数10
已启用问题?
问题数3
打开的问题数2
拉请求数0
打开的拉请求数0
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?