atmosphere

Access pushcontext from EJB-tier

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 12:03:15
问题 Im using Primefaces Push (the new thing in 3.4) together with jsf2 and ejb3. Seperate .war and ejb.jar Now I need to trigger a prime-push event from the ejb tier. What is a clean way to do this? Some options I can think of: ManagedBean pass down a callback interface when invoking the ejb method A JMS messagelistener in the web-tier and ejb to send messages. Managed bean to analyze returned data from ejb method invocation and do push if conditions are met. Basicly the question is where to put

HTML5 Server sent events and multiple clients (without using Comet)

被刻印的时光 ゝ 提交于 2019-12-01 10:41:03
I have a usecase for which I would like to know if HTML5's Server-sent-Events is suitable. Multiple clients (Javascript+HTML5 browsers) connect to the web server (with a Java EE backend). Each client could be looking at a different view at any time, depending on what is their object of interest. My Question is: How to keep multiple clients (on different views) up-to-date on the updates happening on the server-side, without flooding all clients with all updates on all views ? Important points that I need to consider are: Many clients might be interested in the same events. If two clients are

Atmosphere responses, broadcasts do not call javascript onMessage handler

余生颓废 提交于 2019-12-01 06:08:22
问题 I'm working with atmosphere trying to get the simple base implementation using atmosphere 2.0.3 tomcat 7.0.42 running locally in my eclipse environment (also connecting from external machine to see traffic with wireshark). The problem I am experiencing is no matter what transport I use, websocket, sse, polling, long-polling, the broadcast response never seems to get to the client and the response.OnMessage handler is never invoked. I receive no exceptions during runtime, and I have tried with

Atmosphere/Jersey bidirectional conversation

徘徊边缘 提交于 2019-12-01 00:47:15
I've seen a number of Atmosphere examples including pub-sub. I want to do something like pub-sub (client subscribes to a channel that is unique to that client; server periodically publishes to that channel), except that the client will send data to the server as well. The client will send data in response to data sent by the server and in other cases when something important happens on the client that the server needs to know about (which the server doesn't need to acknowledge). Is it even possible to do this with Atmosphere? It might look something like this: @Stateless @Path("/id/{clientId}

Unable to broadcast to single connection using Atmosphere runtime

こ雲淡風輕ζ 提交于 2019-11-30 12:20:27
问题 I am using Atmosphere runtime 0.6 Snapshot. Tomcat 7 is logging correctly that I am using the Http11 Nio connector and there is no warning that BlockingIO will be used. I am trying to send messages to three kinds of channels. Global Broadcaster - broadcast to all suspended resources. (All) Broadcast to a particular resource (say, Partner) Broadcast to current resource (Self) When a login action occurs, what all do I have to store in session in order to achieve this kind of broadcasting? Some

Atmosphere + Jersey: How do I have multiple broadcasters?

天大地大妈咪最大 提交于 2019-11-29 22:38:19
问题 I have a working Jersey/Atmosphere/Guice application which has two Atmosphere Resources. The first is pretty much a clone of the example chat application: @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

Websocket frame size limitation

梦想与她 提交于 2019-11-29 09:15:36
I'm sending huge chunks of JSON data through websockets. The JSON may have over 1000 entries. Due to the frame size limitation, the Websocket protocol automatically splits the JSON into frames, which cannot be helped. As we cannot change the frame size of websockets. The problem: When I try to evaluate my JSON using JSON.parse it gives me a parsing error which is obvious because the frames are not complete JSON objects. All this happens in the Websocket onmessage event callback. How can I recieve the huge JSON in differnt frames and still be able to parse it? I have tried to concat the frames

Can not deserialize instance of java.lang.String out of START_OBJECT token

拜拜、爱过 提交于 2019-11-28 07:55:09
I'm running into an issue where my deployable jar hits an exception that doesn't happen when I run this locally in IntelliJ. Exception: Receiving an event {id=2, socket=0c317829-69bf-43d6-b598-7c0c550635bb, type=getDashboard, data={workstationUuid=ddec1caa-a97f-4922-833f-632da07ffc11}, reply=true} Firing getDashboard event to Socket#0c317829-69bf-43d6-b598-7c0c550635bb Failed invoking AtmosphereFramework.doCometSupport() java.lang.IllegalArgumentException: Can not deserialize instance of java.lang.String out of START_OBJECT token at [Source: N/A; line: -1, column: -1] at org.codehaus.jackson

Websocket frame size limitation

岁酱吖の 提交于 2019-11-28 02:38:44
问题 I'm sending huge chunks of JSON data through websockets. The JSON may have over 1000 entries. Due to the frame size limitation, the Websocket protocol automatically splits the JSON into frames, which cannot be helped. As we cannot change the frame size of websockets. The problem: When I try to evaluate my JSON using JSON.parse it gives me a parsing error which is obvious because the frames are not complete JSON objects. All this happens in the Websocket onmessage event callback. How can I

Can not deserialize instance of java.lang.String out of START_OBJECT token

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 01:44:16
问题 I'm running into an issue where my deployable jar hits an exception that doesn't happen when I run this locally in IntelliJ. Exception: Receiving an event {id=2, socket=0c317829-69bf-43d6-b598-7c0c550635bb, type=getDashboard, data={workstationUuid=ddec1caa-a97f-4922-833f-632da07ffc11}, reply=true} Firing getDashboard event to Socket#0c317829-69bf-43d6-b598-7c0c550635bb Failed invoking AtmosphereFramework.doCometSupport() java.lang.IllegalArgumentException: Can not deserialize instance of java