0

in my favorite scenario, I have mutliple dynamic nodes running a identical sails.js app. The nodes need to send messages each other. I try to archieve this through a redis db with a node model. Each server subscribes to all models and creates one for himself. This could be done easily on a client with sails.io.js.

But how can I subscribe and register callback functions to model rooms at server code? These nodes cannot communicate through tcp, because they are living in a isolated docker environment. Any thoughts would be greatly appreciated!

twinkie
  • 31
  • 6

1 Answers1

1

Put your nodes on the same docker network to allow them to discover each other. If you not familiar with docker networks yet, I recommend to read Understand Docker container networks, it's an awesome tool.

This could be done easily on a client with sails.io.js.

It is totally possible. You have to use the socket.io.js client on the server: https://github.com/balderdashy/sails.io.js

For server to server communication I prefer Publish/Subscribe messaging tools like redis PupSub http://redis.io/topics/pubsub or https://www.rabbitmq.com/

DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
  • took the redis messaging path. It is really straight forward and is exactly what i need. Intra node communication without any configuration needs or knowledge about infrastructure and existing nodes – twinkie Oct 04 '16 at 07:13