Summary

In this chapter, we discussed about messaging using the WebSocket protocol in depth. We took an overview of why WebSocket is important, and how it differs from the traditional web applications as well as the XMLHttpRequest based AJAX applications. We discussed the areas in which WebSocket can play a vital role. Spring provides an API to work with WebSocket. We looked at WebSocketHandler and WebSocketConfigurer and its registration using both Java classes as well as XML-based configurations using the Capital of Country application. The SockJS library provides a cross-browser JavaScript API to enable low latency and cross-domain communication between the browser and server. We enabled SockJS, both in XML and Java configuration. We also saw, in depth, how to use STOMP in WebSocket over SockJS, and to enable it and its event handling methods.

We are handling web requests from the last three chapters. We are well aware of most of the in and outs of handling web request and response to develop a web application. However, for all the applications that we developed up until now, the user needs to wait for the response once he requests for the data. It is a waste of browsing time for the user, and, most importantly, a waste of server resource. We are now looking forward to develop the applications without blocking. Yes, it's reactive programming. In the next chapter, we will discover reactive web programming in detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.35.81