Send Notification to specific user in spring boot websocket

后端 未结 2 1534
孤街浪徒
孤街浪徒 2021-02-07 11:30

I want to send notification to specific client.

e.g username user

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfiguration exten         


        
2条回答
  •  -上瘾入骨i
    2021-02-07 11:40

    Seems you are missing a slash in your destination:

    template.convertAndSendToUser(principal.getName(), "/queue/notification", notifications); 
    

提交回复
热议问题