From the course: Java EE 8: Web Services

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use server-sent events (SSE) in JAX-RS

Use server-sent events (SSE) in JAX-RS - Java EE Tutorial

From the course: Java EE 8: Web Services

Start my 1-month free trial

Use server-sent events (SSE) in JAX-RS

- [Instructor] Now let me show you how to include SSE. That's Server-Sent Events in your JAX-RS web service. First, a quick recap of what SSE is. In standard web service communication, a web service client opens a connection to a server and sends data, expecting to get a response. SSE allows the server to keep communicating with the client, without the client necessarily having to initiate the conversation or keep it going. So, after the SSE connection is open, by prompting from the client, the server can continue to send data to the client, without any prompting from the client. Now that's out of the way, let's get your SSE going. Like all the other Jersey tools we've been working with, the dependencies you'll need for this example will be provided by the Glassfish application server. So you don't need to do anything in your pump, if you're working with Glassfish or Payara. For my Apache Tomcat crew, though, we need to add…

Contents