0 Replies Latest reply on Mar 12, 2015 4:19 AM by s.mehlhase

    WebSockets onMessage method called out of order




      I'm developing a @ServerEndpoint for a WebSocket client on WildFly 8(.2.0.Final). The client actually sends unfragmented (WebSocket) messages in rapid succession. I assumed the order of receiving these should be the same as the order in which they are sent. Note that since WebSockets are based on a (single) TCP session on top of HTTP, so TCP guarantees that the messages will arrive in order at the server itself. So, the messages all arrive at the server, but are delivered to my @ServerEndpoint not in the order they were sent. Sometimes to consecutive messages are switched. However, this only happens if I do not fragment the messages (with fragment I mean fragmentation based on the WebSocket RFC (6455). If I send fragmented messages, all fragments and messages do arrive at the @ServerEndpoint in the same order as they were sent.

      Since the behaviour is somehow not consistent between fragmented and unfragmented messages, I ask myself whether this is at all report-worthy and whether this ultimatively is a bug, or whether a feature request to force sequential delivery might be more appropriate?

      I know that other implementations of the protocol are not at all interesting, but I have never seen this behaviour on other implementations of the protocol.