[jax-rs-spec users] Re: How is an SSE method selected

From: Sergey Beryozkin <>
Date: Fri, 13 Nov 2015 10:46:56 +0000

Unless of course in the reality the browsers do always set an SSE MT, in
which case there's no problem...
Any comments from the spec leads at all ? Given this has been working on
Jersey for a long time now, what is your experience with that,
can one expect the complaint browsers always set Accept:
text/event-stream ?

Thanks, Sergey
On 12/11/15 21:56, Sergey Beryozkin wrote:
> Really ? So if no Accept is set by a browser client then a JAX-RS
> method that does not initiate an SSE output channel can be selected ?
> Sergey
> On 12/11/15 18:22, Markus KARG wrote:
>> As it is no special case at all, it simply is selected in case it is
>> the best matching method.
>> *From:*Sergey Beryozkin []
>> *Sent:* Donnerstag, 12. November 2015 13:12
>> *To:*
>> *Subject:* How is an SSE method selected
>> Hi All
>> It is somewhat related to the earlier discussion.
>> From SSE [1]:
>> "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
>> <>|,
>> 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