I have a websocket server based on Jetty v9.3.9 The server sends text messages to clients from different Threads. A single client can receive multiple simultaneous messages from 2 different threads. For example: Thread 1: "message A" Thread 2: "message B"
Sometimes, not all the times, but around 4-5% of the time, the client doesn't receive all the messages. It receive either message A or B. The client is based on the browser.
I tested in both Firefox and Chrome, and I looked in web console to see if the message is received and is not.
The code I'm using for sending the message is
getSession().getRemote().sendString(this.message);
Is this the right way to do this? Should I use sendStringByFuture(String text)
? Am I missing something.
On the server I have around 800-1k connected clients, that sends and receives multiple messages from different threads.
NOTE: I used websockets with Jetty since version 8 and I can't remember having this problems until I updated to 9, however I can't go back.
Thank you