[jax-rs-spec users] Server Sent Events

From: <>
Date: Wed, 8 Mar 2017 10:32:54 +0100


I read which asked for comments here, so here goes:

I’ve used SSE a couple of times now and I notice that my use case usually is different from what I see in most examples. The examples usually have an action that takes a lot of work to complete.

My use case is normally that a request is started and it kicks off another process outside my application. The response sits there and waits for that process to complete. Some trigger, usually an incoming request, in my application will find the response and send an event when needed. So I do not want to allocate a separate thread for managing the SseEventSink. Rather I usually end up with something like this: . The downside of that is that it leaves me with warnings from the auto-closable.

(If you’re interested, usage is on line 258 and 353 (which is called from the function starting on line 284) of

Is my use-case rare? Should I not be doing this with SSE?