bragg-sqs
SQS middleware for bragg
Handle SQS events as bragg requests.
About
SQS is an event source for AWS Lambda, see the link for more information about configuration. Keep in mind that in case of errors, the request is retried untill it succeeds or the message retention period is expired.
Source: Retries on error with event sources with AWS Lambda
If you configure an Amazon SQS queue as an event source, AWS Lambda will poll a batch of records in the queue and invoke your Lambda function. If it fails, AWS Lambda will continue to process other messages in the batch. Meanwhile, AWS Lambda will continue to retry processing the failed message.
Install
$ npm install bragg-sqs
Usage
const app = ;const router = ;const sqs = ; // Listen for events in the `TopicName` topicrouter; app;app; exportshandler = app;
The sqs:
prefix is added by the middleware to the queuename from where the events are generated. The message of the event is provided in the body
property of the request
object.
API
braggSqs()
Install the bragg SQS middleware.
License
MIT © Simon