Код: Выделить всё
@Path("/chat")
@AtmosphereService(broadcaster = JerseyBroadcaster.class, path = "/chat")
public class ChatResource {
@Suspend(contentType = "application/json")
@GET
public String suspend() {
return "";
}
@Broadcast(writeEntity = false)
@POST
@Produces("application/json")
public Response broadcast(Message message) {
return new Response(message.author, message.message);
}
}
Код: Выделить всё
@Path("/notifications")
@AtmosphereService(broadcaster = JerseyBroadcaster.class, path = "/notifications")
public class NotificationsResource {
@Suspend(contentType = "application/json")
@GET
public String suspend() {
return "";
}
}
Код: Выделить всё
MetaBroadcaster.getDefault().broadcastTo("/*", new Response(...));
Код: Выделить всё
MetaBroadcaster.getDefault().broadcastTo("/notifications", new NotificationResponse(...));
Код: Выделить всё
org.atmosphere.cpr.MetaBroadcaster - No Broadcaster matches /notifications.
Вопрос: как сделать так, чтобы у этих двух ресурсов были разные вещатели с разными ID/Именами?
Подробнее здесь: https://stackoverflow.com/questions/216 ... oadcasters
Мобильная версия