Hi,
I am in the process to upgrade Payara from an old release (Payara Micro 5.201) to a newer Payara Micro 5.2022.5. The new deployments works almost entirely well except that several SSE broadcast endpoints are not working as expected. There is no error associated, simply not broadcasting any event.
Please note that this code is working several years perfectly on PayaraMicro 5.201. On Payara 5.2023.5 doesn’t throw any error but the broadcasters seem not to work as expected.
Please if you have any clue about it, i’d appreciate any help.
Please find below several snippets of code.
JDK 11.
/* Keeps a SSE broadcaster */
private SseBroadcaster broadcaster;
/* Injects SSE instance */
@Context
Sse sse;
/* Creates a new SSE broadcaster */
this.broadcaster = sse.newBroadcaster();
@GET
@Path("stream")
@Produces(MediaType.SERVER_SENT_EVENTS) // sse
public void getTrackingEvents(@Context SseEventSink eventSink) {
broadcaster.register(eventSink);
}
final OutboundSseEvent event = sse.newEvent("test Event");
// this.sse.newEventBuilder().name("event").mediaType(MediaType.APPLICATION_JSON_TYPE)
// .data(String.class, message.getCommand()).build();
broadcaster.broadcast(event);