Our team has developed Server-Sent events (SSE) for a specific task.
I am trying to build a client to listen to event streams from our server. I have sort of managed to do this using the Jersey libraries for Java. However since most of our client code uses Spring, I would like to have an example of how this could be done using Spring.
I was able to find many examples on SSE on the server side for Spring. However I am unable to find any documentation for the client side.
Does Spring support SSE on the client side? If yes, may I have an example of how the following can be achieved using Spring...
Send an HTTP GET request to our server...
GET -> http://example.com/api/events/
headers ->
Accept:text/event-stream
sessionKey:someString
The response will be a text stream, that the client will continue to receive, until the client chooses to close the connection.