What are SSEs?
In this section, we're going to take a look at SSEs, and take a look at some of its usage scenarios. We'll then be implementing and sending a simple SSE on the server side using JAX-RS. Next up, we'll implement SSE on the client-side using JAX-RS and HTML. Finally, we will have a look at sending and receiving server-sent broadcast events to implement something like a simple HTML chat client.
We're going to take a look at SSEs, what they are, and some usage scenarios. We will also have a look at some differences to other related technologies like WebSockets, Polling, and Long Polling.
So, what are SSEs, exactly? They are a very simple HTTP-based API, dedicated to Push communication, and currently SSEs are implemented in most recent browsers like Firefox, Chrome, Safari, and Opera. Unfortunately, SSEs are currently not implemented in Internet Explorer or Edge.
SSE allows you to send simple text data from the server to the client. One important thing: SSEs are one-way in communication...