R
R
Roman2019-10-15 19:03:48
Java
Roman, 2019-10-15 19:03:48

How to send a message to a distributed system websocket?

There is a system
5da5f1d7730de270316309.png
Web socket client connects to some server, as the balancer says, for example server 1.
The operator connects to server 2. The operator needs to send a web socket message to the client. How to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xfg, 2019-10-15
@lampa

You need to somehow implement the pub/sub mechanism . For example, through redis . All servers subscribe to a redis channel. One of the servers publishes a message to the redis channel. All servers receive the message and then send it to their websocket clients.
A similar implementation for the socket.io library can be found here /

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question