From the course: Building Real-Time Web Apps with Spring Boot and WebSockets

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Create the message broker

Create the message broker

From the course: Building Real-Time Web Apps with Spring Boot and WebSockets

Start my 1-month free trial

Create the message broker

- [Instructor] To take advantage of Spring support for adding service side WebSocket capabilities to our app we will need to create and configure what is called a message broker component. The message broker is responsible for bridging the data flow between the client code, which is typically your java script code, and your Spring MVC components. Also, remember the WebSocket protocol is bidirectional, which means a client can subscribe to a topic and a service can publish topic updates to clients based on whatever logic is implemented in the server. Once a WebSocket connection is established, both the client and the server can exchange information endlessly until the connection is closed by any one of the parties. For this reason, a WebSocket connection is typically preferred over A2DP when the client and server need to exchange information at high frequency and with low latency because A2DP connections are closed once a request is served by the server. And there's a time constraint…

Contents