Demo project that use SSE in SpringBoot to send message to UI.
SSE is a server push technology enabling a browser to receive automatic updates from a server via HTTP connection. The Server-Sent Events EventSource API is standardized as part of HTML5[1] by the W3C.
- SpringBoot Starter Web
- Thymleaf
Requirement:
-
JDK8+
-
Maven3+
-
Clone the repository
-
mvn clean install -DskipTests
-
java -jar target/sse-demo-0.0.1-SNAPSHOT.jar
-
Browse
http://localhost:4000
in your browser
Note: IE is not supported, see Browser_compatibility
You can also see the dev tools for detail.