https://github.com/tiagordc/node-red-sqs
Process Node-RED events through AWS SQS and S3
https://github.com/tiagordc/node-red-sqs
aws aws-s3 aws-sqs node-red
Last synced: 3 months ago
JSON representation
Process Node-RED events through AWS SQS and S3
- Host: GitHub
- URL: https://github.com/tiagordc/node-red-sqs
- Owner: tiagordc
- License: mit
- Created: 2019-11-10T20:40:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-14T07:41:33.000Z (over 6 years ago)
- Last Synced: 2025-02-05T06:36:53.490Z (over 1 year ago)
- Topics: aws, aws-s3, aws-sqs, node-red
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```javascript
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
```javascript
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"