0

Let say I have a lot of clients connected via WebSocket to several server instances. Each client has own id, and in cluster I have events that belongs to particular client. So it looks like I have a lot of topics, where each topic = client id. (e.g. messenger: every client listens to events of particular chat)

Is there some ready to use open platform present to solve this problem?

P.S. Result of my brief investigation:

  • Rabbitmq, Kafka, etc - don't fit, because they aren't assume a lot of topics.

  • Redis pubsub - sends each message to every node, that makes it not scalable (if I add new node to Redis cluster, it will receive same number of messages)

  • Hazelcast - sends subscription event to every node, that makes it profitable when number of nodes less than number of messages during client session (for example it's not profitable when I send subscription message to 5 Hazelcast nodes just to send 1 event with payload)

I tried to use next approach: when server wants to subscribe to some event, it saves own address to Redis. And when new event occurs, publisher retrieves address from Redis and sends message directly to subscriber via rpc. But this approach has a lot of corner cases and is expensive for maintaining.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.