I am using Springwebsockets with the STOMP protocol over Websockets, and i am using the in memory borker. I want to send messages to specific users. On the client side i subscribe to a private topic:
stompClient.subscribe('/user/topic/private', function(greeting){
});
And i send the message like this:
stompClient.send("/user/"+ user +"/topic/private", {}, message);
This all works fine and i don't have to do anything on the server. But when i log in twice with the same user (eg different browsers, one desktop and one mobile), it doesn't work like i expected. I would expect that the private message ends up in both the browser. However it only seems to end up in the current browser. Is there any better way to do this kind of private messaging? Or did i misunderstand how the private channel works?