WebSocket is a thin and lightweight layer above TCP, suitable for embed messages. As communication protocol, WebSocket provided a bi-directional, full-duplex, and persistent connection between two machines. Once a WebSocket connection is established, the connection stays open until the connection is closed. Check here for the differences between normal HTTP connection and WebSocket.
WebSocket is very suitable for web applications where the client and server need to exchange messages at high frequency but with low latency. As example is trading application in financial industry, which is very time sensitive. Another type of applications including collaboration tools (like chat application) and games.
Spring Framework introducing
spring-websocket module since version 4, with comprehensive WebSocket support. This module is not only compatible with the Java WebSocket API standard, but also provides additional value-add. This is included a set of annotations and key abstractions from the Spring Integration project such as
MessageHandler, and many others.
Tutorials in this series:
Spring Boot + WebSocket Basic ExampleWebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. In this post, we will learn to create a simple web application, that will broadcast message using plain WebSocket connection.
Spring Boot + WebSocket With STOMP TutorialSTOMP is a simple text-based protocol, designed for working with message-oriented middleware (MOM). In this article we will walk through on how to create WebSocket connection in Spring Boot using STOMP protocol.
Build a Chat Application Using Spring Boot and WebSocketIn this article we will build a simple chat application, using Spring Boot, WebSocket, STOMP and SockJS to send and receive messages to/from a single user.
Getting Started With Spring BootSpring Boot is a project built on the top of the Spring framework. It provides a simpler and faster way to set up, configure, and run applications.