package org.aktin.broker.notify;

import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.sse.SseEventSink;
import javax.ws.rs.sse.Sse;
import javax.ws.rs.sse.SseBroadcaster;

@Singleton
@Path("/broker/events")
public class BrokerSSE {
	private Sse sse;
	private SseBroadcaster broadcaster;

	public BrokerSSE(@Context final Sse sse) {
		this.sse = sse;
		this.broadcaster = sse.newBroadcaster();
	}
 

	@GET
//	@Produces(MediaType.SER)
	public void getServerSentEvents(@Context SseEventSink eventSink) {
		this.broadcaster.register(eventSink);
		
	}
}

package org.aktin.broker.notify;

//import javax.inject.Singleton;
//import javax.ws.rs.GET;
//import javax.ws.rs.Path;
//import javax.ws.rs.Produces;
//import javax.ws.rs.core.Context;
//import javax.ws.rs.core.MediaType;
//import javax.ws.rs.sse.SseEventSink;
//import javax.ws.rs.sse.Sse;
//import javax.ws.rs.sse.SseBroadcaster;

//@Singleton
//@Path("/broker/events")
public class BrokerSSE {
//	private Sse sse;
//	private SseBroadcaster broadcaster;
//
//	public BrokerSSE(@Context final Sse sse) {
//		this.sse = sse;
//		this.broadcaster = sse.newBroadcaster();
//	}
// 
//
//	@GET
////	@Produces(MediaType.SER)
//	public void getServerSentEvents(@Context SseEventSink eventSink) {
//		this.broadcaster.register(eventSink);
//		
//	}
}

disable non-functional BrokerSSE class