spring-websocket-test icon indicating copy to clipboard operation
spring-websocket-test copied to clipboard

Example for Sending Asynchronous messages using spring?

Open svsteja opened this issue 9 years ago • 0 comments

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

svsteja avatar Mar 31 '16 14:03 svsteja