The WebSocket wrapper
Then we can initialize a WebSocket from our application:
We have used lambdas for event handlers to take advantage of GWT 2.8.0 Java 8 capabilities. Finally, we have used Spring Boot, and Spring’s support for WebSockets to implement a server that sends a notification each 2 mins to our app, and also can receive messages and display them on the console.
Our WebSocket configuration looks like:
The SocketHandler implementation can be found here.
and finally, we need to implement our scheduling module that sends a message every two minutes: