I'm using spring WebSocket and I don't know how to send messages to a specific partition that contains the username.
i.e.:
@MessageMapping("/getNotifications")
@SendTo("/topic/notifications")
public @ResponseBody List<NotificationResponse> getNotificationsWS(int size,
SimpMessageHeaderAccessor headerAccessor, Principal principal) throws Exception {
ActionResult<List<NotificationResponse>> notificationsAr;
notificationsAr = this.listNotifications(size, principal);
return notificationsAr.getResult();
}
I'm trying to send the messages to "/topic/notifications/myUserName" instead of "/topic/notifications". In this way each logged user consumes from his own partition.
How I can do it?