Skip to content

tiagordc/node-red-sqs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-red-sqs

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.

Node-RED runtime changes

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);
}

Required ENV variables

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"

About

Process Node-RED events through AWS SQS and S3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published