Targeted Messaging to Specific Users
Send private, per-user messages over STOMP using user destinations, @SendToUser, and SimpMessagingTemplate.convertAndSendToUser.
Beyond Broadcasts
So far messages went to a /topic that every subscriber receives. Real apps also need private messages: a chat whisper, a personal notification, an order update for one customer.
User Destinations
Spring supports the /user destination prefix. When a client subscribes to /user/queue/notifications, Spring rewrites it to a unique, per-session queue so only that user gets the message.
All lessons in this course
- WebSocket Interceptors
- Message Converters Customization
- User Session Management
- Targeted Messaging to Specific Users