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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?