October 2018
Intermediate to advanced
590 pages
15h 5m
English
Spring's WebSocket implementation provides an abstraction layer on top of other WebSocket runtimes, such as Tomcat, Jetty, and Undertow. With Spring's abstraction, creating a WebSocket server is as simple as implementing the WebSocketHandler interface. Spring also provides base classes, such as TextWebSocketHandler and BinaryWebSocketHandler, that we can extend directly.
Besides implementing WebSocketHandler, we will also need to provide the configuration so that Spring knows how to bootstrap our WebSocket server. We can do this by implementing the WebSocketConfigurer interface. Here is an example of how a simple WebSocket configuration looks:
@Configuration@EnableWebSocketpublic class WebSocketConfig implements ...
Read now
Unlock full access