[jax-rs-spec users] Re: Server Sent Events

From: <>
Date: Thu, 9 Mar 2017 11:02:21 +0100

Thanks Ondrej, I think our posts have crossed each other.

I think it’s because of my settings; I turn on nearly every warning in Eclipse. The warning I get when returning from the method is: “Potential resource leak” (Properties > Java Compiler > Errors/Warnings > Potential programming problems). I can turn it off by using @SuppressWarnings("resource"). So I guess you should ignore that.



Van: Ondrej Mihályi
Verzonden: donderdag 9 maart 2017 09:30
Onderwerp: [jax-rs-spec users] Re: Server Sent Events

Hi Pavel, I think that Friso's "process" is an abstraction of an external process, which later calls another REST request, which obviously can be fulfilled in a separate thread from the initial request that initiated SSE.

I also think that the Friso's code should work. The only thing that raises my eyebrow is why would map.put(key, eventSink) create a warning on a yet unclosed eventSink. 
Is that really true, Friso? Can you share the warning you get? I believe it should be OK to store an open eventSink in a map and retrieve it by another thread, I see no reason for a warning.


2017-03-09 8:20 GMT+01:00 Pavel Bucek <>:
Hi Friso,
the example in JAX-RS and your case is the same.
We are using executor service to show that it IS possible to send/store SseEventSink instances and work with them from another Thread.
Having said that, your case is ok and will work as it does now. The only thing is (and I believe that is just a "typo" on your side) is that it must be different Thread, not a Process, as is mentioned in the code snippet you've presented.
Best regards,

On 09/03/2017 00:24, wrote:
Hi Pavel,
Does this clear things up?