spring-websocket-test
spring-websocket-test copied to clipboard
Example for Sending Asynchronous messages using spring?
It would be greatly helpful if there are any examples how to send asynchronous messages using spring websockets..
In this link https://github.com/rstoyanchev/spring-websocket-test/blob/master/src/main/java/org/springframework/samples/websocket/echo/EchoWebSocketHandler.java
@Override public void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception { String reply = this.echoService.getMessage(message.getPayload()); session.sendMessage(new TextMessage(reply)); }
Here we are sending session.sendMessage is a synchronous call..How to send asynchronous messages? using same websocket session