spring-guides / gs-messaging-stomp-websocket

Using WebSocket to build an interactive web application :: Learn how to the send and receive messages between a browser and the server over a WebSocket

Home Page:http://spring.io/guides/gs/messaging-stomp-websocket/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

convertAndSendToUser not work

An0nymous0 opened this issue · comments

messagingTemplate.convertAndSendToUser(headerAccessor.getSessionId(),"/user/queue/greetings", new Greeting("Hello, " + HtmlUtils.htmlEscape(headerAccessor.getSessionId()) + "!"));

stompClient.subscribe('/user/queue/greetings', function (greeting) { showGreeting(JSON.parse(greeting.body).content); });