With this plugin each message passes through Amazon Simple Queue Service (SQS) and S3 allowing Node-RED load balancing and flow replay.
Messages will no longer be real-time!
To use this download the sources or clone this repo.
packages > node_modules > @node-red > runtime > lib > index.js
var sqs = require("node-red-sqs");
...
function start() {
return ...
.then(function() {
return sqs.init(function(msg) {
if (msg && msg._msginfo) {
var node = redNodes.getNode(msg._msginfo.to);
if (node) {
delete msg._msginfo;
node.receive(msg);
}
}
});
});
}
packages > node_modules > @node-red > runtime > lib > nodes > Node.js
var sqs = require("node-red-sqs");
...
Node.prototype.send = function(msg) {
sqs.send.call(this, msg);
}
AWS_ACCESS_KEY_ID": "ACCESS ID"
AWS_SECRET_ACCESS_KEY": "ACCESS KEY"
AWS_FLOW_SQS": "SQS FIFO QUEUE URL"
AWS_FLOW_S3": "AWS S3 BUCKET NAME"