I think I found a solution for your problem:
You have to subscribe to the user specific topic. In my example I've created a topic /topic/progress.
I subscribe to /user/topic/progress
stompClient.subscribe('/user/topic/progress', progressMessage => { ... }) I've created a component that listens for the SessionSubscribeEvent in order to react on new subscriptions:
@Component public class WebSocketEventListener { @Autowired private WebSocketService webSocketService; @Autowired private ProgressService progressService; @EventListener public void handleWebSocketConnectListener(SessionSubscribeEvent event) throws IllegalAccessException { if(Objects.equals(event.getMessage().getHeaders().get("simpDestination"), "/user/topic/progress")) { webSocketService.sendCurrentProgessToUser(progressService.getProgress(), event.getUser().getName()); } } } The WebSocketservice is used to send the messages to the subscribing users. I have a method to broadcast stuff to a topic and one to send it to specific users only. The broadcast method isn't the original one. I use the SimpUserRegistry to get all subscribers and send the message to each separately:
@Controller @Service public class WebSocketService { @Autowired private SimpMessagingTemplate simpMessagingTemplate; @Autowired private SimpUserRegistry simpUserRegistry; private static final String WS_PROGRESS_DESTINATION = "/topic/progress"; public void broadcastCurrentProgress(Progress cocktailprogressprogress) { ProgressDto progressDto = new ProgressDto(Progressprogress); List<String> subscribers = simpUserRegistry.getUsers().stream() .map(SimpUser::getName).collect(Collectors.toList()); for(String username : subscribers) { simpMessagingTemplate.convertAndSendToUser(username, WS_PROGRESS_DESTINATION, ProgressDtoprogressDto); } } public void sendCurrentProgessToUser(@Nullable CocktailprogressProgress cocktailProgressprogress, String name) { Object cocktailprogressDto = "DELETE"; if(cocktailProgress != null) { ProgressDto cocktailprogressDtoprogressDto = new CocktailprogressDtoProgressDto(cocktailProgressprogress); } simpMessagingTemplate.convertAndSendToUser(name, WS_COCKTAIL_DESTINATIONWS_PROGRESS_DESTINATION, cocktailprogressDtoprogressDto); } }