Building Webservices with Java EE 8 - Packt Publishing Video Course Section 5
In this video we are talking about the benefits and possible usage scenarios of Server-sent events.
In this video we are implementing simple asynchronous web services.
Method | URI | Media Type | Description |
---|---|---|---|
GET | /api/events | text/event-stream | Get and open the SSE stream to receive push events |
POST | /api/events | / | Post any message to be pushed to an open SSE stream |
DELETE | /api/events | / | Close any open SSE event stream |
In this video we are showing how to implement a JAX-RS REST client sending and receiving SSE.
In this video is showing how to subscribe and broadcast SSE events to all registered clients.
Method | URI | Media Type | Description |
---|---|---|---|
GET | /api/broadcast | text/event-stream | Get and open the SSE stream of broadcasted messages |
POST | /api/broadcast | application/x-www-form-urlencoded | Send a broadcast message |
$ mvn clean verify
$ docker build -t sse-service:1.0 .
$ docker run -it -p 8080:8080 sse-service:1.0