I have a Spring application and it sends messages to another server asynchronously via Spring WebSocket . But for a specific case I need to send a message synchronously, I should continue the process with incoming response from the server.
I don’t want to make an HTTP call only for this process because there is already an open TCP connection, and I want to use it.
For example in Tyrus WebSocket implementation it is possible to send message synchronously or asynchronously via
session.getBasicRemote().sendText(message);
session.getAsyncRemote().sendText(message);
Related Tyrus documentation link.
Btw, I don’t use a sub-protocol
like STOMP with Spring WebSocket.