jsr370-experts@jax-rs-spec.java.net

How is an SSE method selected

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Thu, 12 Nov 2015 12:11:39 +0000

Hi All

It is somewhat related to the earlier discussion.
 From SSE [1]:

http://www.w3.org/TR/2009/WD-eventsource-20091029/#processing-model

"For HTTP connections, the |Accept| header may be included; if included,
it must contain only formats of event framing that are supported by the
user agent (one of which must be |text/event-stream
<http://www.w3.org/TR/2009/WD-eventsource-20091029/#text-event-stream>|,
as described below)."

So, if Accept: text/event-stream is included, I can see how having
@Produces(text/event-stream) can indeed help in relying on the existing
JAX-RS mechanism to ensure that the relevant method is selected.

However, the language above implies that it is optional to have Accept
for initiating an SSE channel. What happens if Accept is omitted - how
will the method be selected in that case ?

Thanks, Sergey