Member-only story
Message Queues Made Simple with SQS, Lambda, NodeJS, and Serverless
A quick guide to setting up a Lambda function to receive messages from an SQS messaging queue with the Serverless Framework.
Serverless computing is an exciting technology and has many practical applications for building scalable applications in a cloud environment. One extremely practical use case is receiving messages in a messaging queue. In this article, I will be building an example to demonstrate this by connecting an SQS messaging queue to a Lambda function which can be accomplished quite simply by utilizing the Serverless Framework.
Large web applications have many moving pieces and some have functionality that is better performed behind the scenes rather than making users wait. One example of this is file processing. If you are accepting files from users and performing some type of processing on those files this can be time-consuming and not mention may have many steps to perform for a single transaction. For situations like this depending on how long the processing takes you may not want to perform the processing while your users are waiting.
This is a good opportunity to harness the power of messaging queues. With a queue in place, you can drop messages in with the info needed to perform…