https://github.com/openliberty/sample-jaxrs-sse
https://github.com/openliberty/sample-jaxrs-sse
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/openliberty/sample-jaxrs-sse
- Owner: OpenLiberty
- Created: 2017-10-04T14:12:23.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2022-03-01T19:18:41.000Z (over 4 years ago)
- Last Synced: 2026-02-27T04:29:49.232Z (3 months ago)
- Language: Java
- Size: 7.81 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sample-jaxrs-sse
Here is a simple demo of Server Sent Events - a new part of the JAX-RS 2.1 spec. This sample application is described in a
blog post that provides a [quick overview of SSE](https://www.linkedin.com/pulse/my-favorite-part-jax-rs-21-implementers-view-j-andrew-mccright/).
This sample creates a "radio" service similar to Pandora or Spotify that will randomly "play" songs. The JAX-RS resource on
the server sends events that tell the client what song is currently playing, along with the artist performing the song and the
time (in milliseconds) that the song will last. For this demo, all of the song lengths are significantly shortened.
There is a server-based client that will consume those song events and simply print them out as they are received. This is
the approach used for the integration test. There is also a Javascript-based client that can be used when deploying this
sample manually.
This sample uses an old build of OpenLiberty, but should be able to run in any Java EE application server that supports JAX-RS
2.1.
To run, either clone or download this project's source, and then enter: `mvn install`