简体   繁体   中英

Message queue which can be used with Node.js for sending data to multiple clients

  • I have a booking application where 3 to 4 devices are used for a single location. Many of these locations have bad internet connectivity, so the idea is to store data in localstorage of the device. I want the data sent by one device to go to server and then sent to other devices for them to store it locally.
  • So at any point of time all the clients will have the data entered or sent from another other device for them to execute it without depending on the server. What will be the best way to implement this type of system. Where even if a single device do not have internet connectivity it should be able to get the data when internet comes. I tried socket.io and read aws message queue and redis also. But some expert advice in this will be very helpful for me.

Why don't you use a publisher/subscriber model like kafka/rabbitMQ, You have a producer and all apps are the consumers, the producer sends messages to its respective topics. All devices are consumers which would pull data from this topic. You can have multiple topics and can even join multiple streams to get a new stream. It is fairly easy to implement as well

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM