Skip to content

Commit

Permalink
[RESTEASY-2563: SseBroadcasterImpl.close() puts notifyOnCloseListener…
Browse files Browse the repository at this point in the history
…s(eventSink) in finally block. (#2396)
  • Loading branch information
ronsigal committed May 9, 2020
1 parent c38c226 commit 177da5a
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -17,6 +17,7 @@
import javax.ws.rs.sse.SseBroadcaster;
import javax.ws.rs.sse.SseEventSink;

import org.jboss.resteasy.resteasy_jaxrs.i18n.LogMessages;
import org.jboss.resteasy.resteasy_jaxrs.i18n.Messages;

public class SseBroadcasterImpl implements SseBroadcaster
Expand Down Expand Up @@ -62,7 +63,13 @@ public void close()
//is it necessay to close the subsribed SseEventSink ?
outputQueue.forEach(eventSink -> {
eventSink.close();
notifyOnCloseListeners(eventSink);
try {
eventSink.close();
} catch (RuntimeException e) {
LogMessages.LOGGER.debug(e.getLocalizedMessage());
} finally {
notifyOnCloseListeners(eventSink);
}
});
}
finally
Expand Down

0 comments on commit 177da5a

Please sign in to comment.