Skip to content

Instantly share code, notes, and snippets.

@shams-ali
Created June 25, 2016 04:20
Show Gist options
  • Save shams-ali/301e34d155dc6796c66626a8387c0dc2 to your computer and use it in GitHub Desktop.
Save shams-ali/301e34d155dc6796c66626a8387c0dc2 to your computer and use it in GitHub Desktop.
sqs send to queue
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