0Pricing
WebSockets & Real-Time Systems with Spring · Lesson

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

  1. WebSocket Interceptors
  2. Message Converters Customization
  3. User Session Management
  4. Targeted Messaging to Specific Users
← Back to WebSockets & Real-Time Systems with Spring