From the course: AWS for Developers: Data-Driven Serverless Applications with Kinesis (2019)
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Send a message to SQS - Amazon Web Services (AWS) Tutorial
From the course: AWS for Developers: Data-Driven Serverless Applications with Kinesis (2019)
Send a message to SQS
- [Instructor] So now we created the Queue. And we also have the lambda that does nothing, that we have created in the previous chapter. So, now this lambda needs to send a message to the Queue. So, then we can create a new lambda that will send a message to the delivery company. So let's modify a little bit this code so it's sending messages to the Queue. For sending messages to the Queue, what do we need to do is first require the aws-sdk and then we are going to use the module sqs from here. The module sqs, as the one of ses requires a region and we can pass that as a environmental variable. And then we will have a Queue name that we will need to also have as an environmental variable. Now we have set up this and then we need to start playing a little bit with this code. So we are getting our ordersFulfilled in the parameters. So, we will use that, we will go ordersFulfilled by ordersFulfilled and send a message to the Queue one by one. And also, this lambda needs to save the order…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.