Hello,
Jersey SSE implementation sends events as chunked output (with header
"Transfer-Encoding: chunked"). However, the HTML spec discourages from
using chunked response with SSE (see
http://www.w3.org/TR/eventsource/#notes):
"Authors are also cautioned that HTTP chunking can have unexpected
negative effects on the reliability of this protocol. Where possible,
chunking should be disabled for serving event streams unless the rate
of messages is high enough for this not to matter."
I ran into such unreliability issue while implementing an SSE solution
using Dropwizard 0.8.1 with Jersey 2.17 and DOM EventSource as the
client. Events aren't received by the client immediately, but instead
they are stacked up. The behavior is similar to the one described in
https://java.net/jira/browse/JERSEY-2590, except that I'm not using
LoggingFilter.
I need to add that with the same setup I used to have a SSE
implementation using Jetty EventSourceServlet which worked correctly
and didn't use "Transfer-Encoding: chunked".
I believe that Jersey should allow to support serve-sent events without
imposing chunked output.
Regards,
Rafal