How we can share nodered data in another nodejs application which is running in the same server.
Hi Rahul.
From best to worst (IMO)...
You can use MQTT?
You could do HTTP Requests to/from node-red to/from application.
You could use UDP or TCP socket .io
You could launch the nodejs app with command line parameters.
You could write files from node-red and read them in nodejs app.
note: there are many more solutions
TBH, your question is far to open ended.
questions...
- Do you know how to do MQTT?
- Do you know how to create endpoint in nodejs app?
You missed embedding Node-RED in the nodejs app and using UNIX pipes
... or using a database as the glue
but I wanted to be more like a event based, but if I use db it won't be rifght?
Correct. It will not.
Using database was a joke. Look at other suggestions.
MQTT is 100% event based and IMO the best solution (given the limited information at hand)
Perhaps you could answer the questions?...
How about using Redis? Nodered works brilliantly with Redis and if you do a subscription to a Redis channel on your server in nodejs you will probably get an event triggered.
This of course will be depending on installing Redis on the server and uploading the data to Redis.
Nodered is amazing, and Redis is like superman on steroids when it comes to share data.
Yes, REDIS will also work. MQTT is very lightweight though (Mosquitto), not sure about redis. and mqtt fits Node-RED's design principles really well since it was designed with it in the first place and one of the key node-red devs also designed and built one of the most popular mqtt libraries.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.