https://github.com/sbstjn/lawos-serverless
Serverless example for an SQS Worker in AWS Lambda using Lawos
https://github.com/sbstjn/lawos-serverless
aws lambda lawos serverless sqs sqs-poller sqs-queue worker
Last synced: 12 months ago
JSON representation
Serverless example for an SQS Worker in AWS Lambda using Lawos
- Host: GitHub
- URL: https://github.com/sbstjn/lawos-serverless
- Owner: sbstjn
- License: mit
- Created: 2017-03-08T11:04:08.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-09T21:10:54.000Z (about 9 years ago)
- Last Synced: 2025-04-01T16:31:52.802Z (about 1 year ago)
- Topics: aws, lambda, lawos, serverless, sqs, sqs-poller, sqs-queue, worker
- Language: JavaScript
- Size: 7.81 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# SQS Worker for AWS Lambda with Lawos
[](http://www.serverless.com)
[](https://github.com/sbstjn/lawos-serverless)
Example usage of [Lawos](https://github.com/sbstjn/lawos) with [Serverless](https://serverless.com) to process messages from an Amazon SQS queue with AWS Lambda functions.
## Setup
- Use CloudWatch Schedule to run Lambda function every minute
- Use CloudWatch Alarms to run Lambda function if SQS contains more than 100 messages
## Install
```bash
$ > git clone git@github.com:sbstjn/lawos-serverless.git && cd lawos-serverless
$ > npm install
```
## Deployment
```bash
$ > npm run deploy
```
## Invoke worker
```bash
$ > npm run invoke
```
## Add noise to SQS
Use [wrk](https://github.com/wg/wrk) to add some messages to your SQS queue. You need to enable [anonymous access to sendMessage](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/acp-overview.html#anonQueues) for your queue first!
```
$ > wrk -c25 -d10 -t15 \
-s helper/wrk.lua \
https://sqs.eu-west-1.amazonaws.com/YourAccountID/dev-lawos-serverless-backlog
```