Check auth while sending a message to a specific user by using STOMP and WebSocket in Spring
- 阅读更多 关于 Check auth while sending a message to a specific user by using STOMP and WebSocket in Spring
I'm developing a realtime notification system in Spring 4 by using a build-in Message Broker , and STOMP over WebSocket . I would like to be able to send messages to a specific user, according with his username. In order to achieve this goal, I'm using the convertAndSendToUser method of org.springframework.messaging.simp.SimpMessagingTemplate class, as follows: private final MessagingTemplate messagingTemplate; @Autowired public LRTStatusListener(SimpMessagingTemplate messagingTemplate) { this.messagingTemplate = messagingTemplate; } @Scheduled(fixedDelay=5000) public void sendMessages