@OnWebSocketMessage is a Jetty API for whole message delivery of websocket messages.
The internals of Jetty will aggregate the individual frames and then call your method with the entire message.
For WebSocket frames access, don't use annotations, and instead use the org.eclipse.jetty.websocket.api.WebSocketFrameListener.
The only scenario where @OnWebSocketMessage method will be called from different threads is if you are using a streaming based approach to handling.
For each websocket message, the first frame will result in a dispatched @OnWebSocketMessage to you.
Each dispatch will be on a new thread, this is to allow your websocket application the opportunity to read the websocket message via the
java.io Stream APIs.
When the message is finished (fin=true frame received), then the final payload is delivered to your prior dispatched thread and a new message is allowed to be started.
To avoid this dispatch, use String (for websocket TEXT messages) or ByteBuffer (for websocket BINARY messages) object types in your @OnWebSocketMessage method, not streams.
Those are delivered to your application's @OnWebSocketMessage in the same thread as the one managing the reads operations from the internal websocket connection.
_______________________________________________