© Jorge Acetozi 2017

Jorge Acetozi, Pro Java Clustering and Scalability, https://doi.org/10.1007/978-1-4842-2985-9_12

12. Multinode Chat Architecture

Jorge Acetozi

(1)São Paulo / SP, Brazil

Imagine that you want to horizontally scale the chat application by running two instances of the chat app on different servers. Suppose you are using an in-memory SimpleBroker as well.

In Figure 12-1, Jorge and John have a WebSocket connection to server 1, and Xuxa has a WebSocket connection to server 2. What would happen if Jorge tries to send a message to Xuxa? Well, I think you already know the answer! Since Xuxa is not connected to server 1, that server doesn’t know about the user Xuxa. Thus, the message will be lost. However, if Jorge sends a message to John, ...

Get Pro Java Clustering and Scalability: Building Real-Time Apps with Spring, Cassandra, Redis, WebSocket and RabbitMQ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.