Oracle Logo

Server-Sent Events

 

Server-Sent Events (SSE) Introduction

Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. The most common usage of SSE is to allow web applications to push one way asynchronous updates to browsers without having to maintain a million open sockets.

Description of the Example

This example includes a browser-based Web client and a command-line client. Browser-based Web client including Simple SSE and Boradcast SSE. Simple SSE describe how JAX-RS SSE server accept connections and send events to client. Broadcast SSE describe how to send events to multiple clients simultaneously. The command-line client shows how to use the JAX-RS 2.1 client API to receive SSE message in a Java SE environment.

Use This Example

Simple SSE
Broadcast SSE