When application code needs to send a message to a STOMP client connected over WebSocket, it has no access to information such as the WebSocket session (and sessionId) or even which server the client is connected to. This may be needed in an exception handling method, or in an asynchronously executing method that needs to target the user (e.g. with a trade confirmation).
This ticket should make it easy to send messages to a specific user from anywhere within the application.
The support in M2 is enabled through a messaging template that accepts a user name and target destination. There is also an @ReplyToUser annotation that sends the return value as a message to the specified destination based on the currently logged in user.