Reputation: 8107
Are there any real uses cases to send messages to a queue and then have a lambda function pickup messages or would you just simply trigger the lambda function straight away with the message as an input.
Upvotes: 0
Views: 1204
Reputation: 9234
Are there any real use cases of SQS with Lambda? Yes. Amazon's S3 Cross Region Replication Monitoring solution has changes to the S3 bucket notify an SNS topic which pushes the events onto a Queue, and then once a minute, it kicks off a lambda that reads the queue, and looks for S3 events that had both a PUT and a Replica PUT.
That said, if you're looking to fire events, and have Lambdas automatically process those events, then SQS might not be the best system for handling these events. This is because SQS isn't one of the Lambda Supported Event Sources. Depending on your use case and volume Amazon Simple Notification Service or Amazon Kinesis Data Streams would be a better source, and can be configured to directly trigger a Lambda. SQS on the other hand would need to be started in a different way, like in the example above, a CloudWatch Scheduled Event, and stay aware of it's timeout and trigger additional lambda to be able to deal with volume, where as for SNS and Kinesis, these are handled automatically.
Update
As of June 28th you can now register SQS as an event source for lambda.
Check out the Using AWS Lambda with Amazon SQS docs for more information.
Upvotes: 2