Answer the question
In order to leave comments, you need to log in
How to send message to sender via WebSocket?
Hello. I need to issue a response to a specific sender on an incoming message to a web socket. There is the following
@MessageMapping("/terminal")
public void transmitData(@Payload StdInDTO data, Principal user, @Header("simpSessionId") String sessionId) throws Exception{
StdOutDTO stdOutDto = StdOutConverter.toDTO(terminalService.transmitData(StdInConverter.fromDTO(data), sessionId));
simpMessagingTemplate.convertAndSendToUser("Какой-то пользователь", "/user/queue/", stdOutDto);;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question