atmosphere icon indicating copy to clipboard operation
atmosphere copied to clipboard

[jQuery] [long-polling] callbacks for aggregated messages still not fired properly

Open nite23 opened this issue 14 years ago • 4 comments

Possibly related to #568, #552.

Whenever two aggregated messages arrive to client, onMessage is fired only for the last one.

raw message: 142|{"source":{"type":"customer","uuid":"3144563d-2030-4eb6-a989-6fd6c0aebddf"},"payload":{"type":"newD"},"destination":{"type":"deptA","id":164}}142|{"source":{"type":"customer","uuid":"bd10db52-fa93-454d-9209-16761cac5f89"},"payload":{"type":"newD"},"destination":{"type":"deptA","id":164}}

Tested on firefox 15.0.1, glassfish 3.1.2.2, atmosphere 1.0, long-polling transport.

nite23 avatar Sep 13 '12 12:09 nite23

Hum...I did tested several times that scenario. The raw message was sent in one packet, right?

jfarcand avatar Sep 13 '12 12:09 jfarcand

Yes, a single packet.

Here's the response recorded in wireshark: HTTP/1.1 200 OK X-Powered-By: Servlet/3.0 JSP/2.2 (GlassFish Server Open Source Edition 3.1.2.2 Java/Oracle Corporation/1.7) Server: GlassFish Server Open Source Edition 3.1.2.2 Pragma: No-cache Cache-Control: no-cache, no-store, no-cache, must-revalidate Expires: Thu, 01 Jan 1970 01:00:00 CET Expires: -1 Pragma: no-cache Content-Type: application/json;charset=UTF-8 Content-Encoding: gzip Vary: Accept-Encoding Content-Length: 165 Accept-Ranges: bytes Date: Thu, 13 Sep 2012 12:47:01 GMT X-Varnish: 1221946806 Age: 0 Via: 1.1 varnish Connection: keep-alive

a gzipped response body follows. here it's decoded to plaintext: 142|{"source":{"type":"customer","uuid":"cfd3b9ef-807a-4401-8edc-bc510ca5e5d3"},"payload":{"type":"newD"},"destination":{"type":"deptA","id":165}}142|{"source":{"type":"customer","uuid":"3c4dc59f-1603-4b27-9dd1-6d2a9a44c8dd"},"payload":{"type":"newD"},"destination":{"type":"deptA","id":165}}

nite23 avatar Sep 13 '12 12:09 nite23

OK it works as expected with WebSocket, not sure why it has issue with long-polling. Digging

jfarcand avatar Sep 13 '12 20:09 jfarcand

Workaround: set the

 executeCallbackBeforeReconnect : true

jfarcand avatar Sep 13 '12 20:09 jfarcand