@@ -1818,12 +1818,16 @@ its own implementation of `WebSocketMessageBrokerConfigurer` that is marked with
1818
1818
An application can send messages that target a specific user, and Spring's STOMP support
1819
1819
recognizes destinations prefixed with `/user/` for this purpose.
1820
1820
For example, a client might subscribe to the `/user/queue/position-updates` destination.
1821
- This destination is handled by the `UserDestinationMessageHandler` and
1822
- transformed into a destination unique to the user session
1823
- (such as `/queue/position-updates-user123`). This provides the convenience of subscribing
1824
- to a generically named destination while, at the same time, ensuring no collisions
1825
- with other users who subscribe to the same destination so that each user can receive
1826
- unique stock position updates.
1821
+ `UserDestinationMessageHandler` handles this destination and transforms it into a
1822
+ destination unique to the user session (such as `/queue/position-updates-user123`).
1823
+ This provides the convenience of subscribing to a generically named destination while,
1824
+ at the same time, ensuring no collisions with other users who subscribe to the same
1825
+ destination so that each user can receive unique stock position updates.
1826
+
1827
+ TIP: When working with user destinations, it is important to configure broker and
1828
+ application destination prefixes as shown in <<websocket-stomp-enable>>, or otherwise the
1829
+ broker would handle "/user" prefixed messages that should only be handled by
1830
+ `UserDestinationMessageHandler`.
1827
1831
1828
1832
On the sending side, messages can be sent to a destination such as
1829
1833
pass:q[`/user/{username}/queue/position-updates`], which in turn is translated
0 commit comments