Find us on facebook

Oct 29, 2016

Send message to a queue with AWS Lambda Nodejs

Following parameters need to be passed.
var params = {
            MessageBody: JSON.stringify({"platformApplicationArn":arn,
              'token':token_id,
              'message': messageBody,
              'subject':subject,
             }),
            QueueUrl: "https://sqs.ap-region-x.amazonaws.com/xxxxxxxxxxxx/2ndqueue"
      };

Send message to the queue.
sqs.sendMessage(params, function(err, data) {
    if (err){
      console.log(err, err.stack);
     
    }
    else {
      console.log(data);
    }
});

No comments:

Post a Comment