WebSockets

In the HTTP protocol, the communication supports full-duplex, which means the client and server can send data through the channel. The standard way to support this kind of communication is WebSockets. In this specification, both client and server can send data to each other in the persistent connection. Look at the following diagram:

As we can see, the data can be sent and received by the two actors, client, and server—this is how WebSockets works.

In our case, we do not need to send any data to the server during the connection. Because of this characteristic, we will choose SSE. We will learn about them in the following section. ...

Get Spring 5.0 By Example 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.