Atmosphere PubSub with Jersey 2

I am trying to implement pub-sub logic using Atmosphere with Jersey 2.8. I understand that the Jersey atmosphere only supports Jersey 1.x. What do I need to implement pub-sub in Jersey 2? What methods do I need to use and what annotations outside @AtmosphereService:

@Path("/chat/{topic}")
@AtmosphereService(
        dispatch = false,
        interceptors = {AtmosphereResourceLifecycleInterceptor.class, TrackMessageSizeInterceptor.class},
        path = "/chat/{topic}",
        servlet = "org.glassfish.jersey.servlet.ServletContainer")
public class Jersey2Resource {
    private
    @PathParam("topic")
    Broadcaster topic;

I understand this question is pretty broad, but most atmospheric samples seem to rely on Jersey 1.x.

Thank!

+4
source share
1 answer

Remove this AtmosphereResourceLifecycleInterceptor interceptor and write the Get method instead. You can write a new interceptor by expanding this interceptor or following its structure

0
source

Source: https://habr.com/ru/post/1540397/


All Articles