I am developing a node.js project plannig to run on AWS and use Amazon SQS. I am setting up a local development environment using elasticMQ. (https://github.com/adamw/elasticmq) It's cool that the binary is also available through npm.
Is it possible to use AWS SDK for Javascript to make calls to the local sqs-like process? Or must I go via REST interface? Can someone share a code sample for initializing calls to elasticmq?
Many thanks!
OK I found it: ) posting here as it may help someone:
var AWS = require('aws-sdk\\global');
var SQS = require('aws-sdk\\clients\\SQS');
var myCredentials = new AWS.Credentials("x", "x");
var sqs = new AWS.SQS({
apiVersion: '2012-11-05',
credentials: myCredentials,
region: "none",
endpoint: "http://localhost:9324"
});
var params = {};
//sample code from amazon
console.log("calling listQueues");
//call for SQS list
sqs.listQueues(params, function (err, data) {
if (err) {
console.log("Error", err);
} else {
console.log("Success", data.QueueUrls);
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With