A
A
Artem2020-01-09 02:11:56
Node.js
Artem, 2020-01-09 02:11:56

What is the best way to pass data between local nodejs applications?

There are an unlimited number of applications between which you need to transfer JSON-packed data in such a way that all "listening" applications receive this data.
Implemented via nodejs.dgram - reuseAddr = true , each application listens to one port and sends data to it.
But there is a problem - only one application receives the data (in my case, the one that was launched first)
Is there a way to modify it based on udp dgram in such a way that the data reaches each "listening" application.
Or is it better to use other methods? If so, which ones?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2020-01-09
@bingo347

Option 1: write a microservice that will raise the server on a unix-socket and will simply proxy all the data from each connection to all the others.
Option 2: don't fence your bikes and use redis pub/sub or similar.
Option 3: don't fence your bikes and use any message queue like ZeroMQ

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question