Created
June 25, 2016 04:20
-
-
Save shams-ali/301e34d155dc6796c66626a8387c0dc2 to your computer and use it in GitHub Desktop.
sqs send to queue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqs.createQueue({QueueName: 'gmail-channel-webhooks'}, function (err, data) { | |
if (err) return console.log(err); | |
var url = data.QueueUrl; // use this queue URL to operate on the queue | |
// Sending a message | |
// The following example sends a message to the queue created in the previous example. | |
var queue = new AWS.SQS({params: {QueueUrl: url}}); | |
var body = JSON.stringify({ email: '[email protected]', 'historyId': '127f90a30t' }); | |
queue.sendMessage({ MessageBody: body }, function (err, data) { | |
if (err) return console.log(err); | |
console.log(data); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment