Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cargotracker-dev] SSE injection issue related to RealTimeCargoTrackingService

The GET method is invoked here: https://github.com/eclipse-ee4j/cargotracker/blob/7fa4dfa9c937a80f7c8767849ed10b4323028066/src/main/webapp/admin/tracking/mapFrame.xhtml#L147. To be honest, it's all just pretty ordinary SSE code: https://www.baeldung.com/java-ee-jax-rs-sse. I don't think it's possible to guarantee any HTTP method would be invoked before a cargo is updated and an event broadcast case occurs. Indeed the opposite would be the norm, and probably not just for this application. It's OK to simply write some code to skip the broadcast if there are no SSE listeners yet. That said though, I think the specification requires a valid broadcaster to be injected in all cases.

My guess would be that this is yet another Liberty bug/compatibility issue. I would check with the Liberty team as to what the remedy is. As long as it also work with Payara, it's fine. We will look to upgrade to Jakarta EE 9 after Payara 6 is released, but probably not before that.

Hope this helps?

On 5/12/22 2:47 PM, Chanun Ong wrote:
Hi Reza and Cargo Tracker developers, 

I was able to get JMS and the rest of the website working with Cargo Tracker and Open Liberty, but I encountered another issue related to SSE injection where the SSE broadcaster is initialized to a null value. I had a few questions about the issue, which I found inside RealTimeCargoTrackingService under main/java/org/eclipse/cargotracker/interfaces/booking/sse. 

1. I'm seeing that the onCargoUpdated method is invoked, but that the tracking() @GET method is not invoked anywhere in the stack trace. How is registration supposed to take place if tracking() is not invoked and do you happen to know where the tracking() method might be called? I haven't been able to find that out so far. 

2. To work around the null broadcaster issue, a JAX-RS developer recommended that I add a @POST setup() method that will create a non-null broadcaster and make sure that this new setup() method is invoked before any other broadcast-related method is called. Would this be a viable option?

The final recommendation was to potentially use Jakarta EE 9 rather than Jakarta EE 8 to use the restfulws-3.0 feature rather than the jaxrs-2.1 feature, so that's something I would consider if including a new setup() method didn't solve the problem. I can provide detailed steps on how to reproduce the issue and a demonstration of what I'm encountering as well. Thank you so much.

Best,

Chanun Ong
University of California, Berkeley
Electrical Engineering & Computer Science, B.S. 
Class of 2022

_______________________________________________
cargotracker-dev mailing list
cargotracker-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/cargotracker-dev

Back to the top