@@ -1296,18 +1296,14 @@ See <<websocket-stomp-handle-send>>.
1296
1296
[[websocket-stomp-subscribe-mapping]]
1297
1297
==== `@SubscribeMapping`
1298
1298
1299
- `@SubscribeMapping` is used together with `@MessageMapping` to narrow the mapping to
1300
- subscription messages. In this scenario `@MessageMapping` expresses message destination
1301
- mappings for routing purposes, which can be done at the class or at the method level,
1302
- while `@SubscribeMapping` narrows the mapping to subscription messages only.
1303
-
1304
- Methods with `@MessageMapping` and `@SubscribeMapping` support the same
1305
- <<websocket-stomp-message-mapping,method arguments>> as methods annotated only with
1306
- `@MessageMapping` do. However for the return value, in the absence of `@SendTo` and
1299
+ `@SubscribeMapping` is similar to `@MessageMapping` but also narrows the mapping to
1300
+ subscription messages only. Methods with `@SubscribeMapping` support the same
1301
+ <<websocket-stomp-message-mapping,method arguments>> as `@MessageMapping` methods do.
1302
+ The main difference is that for the return value, in the absence of `@SendTo` and
1307
1303
`@SendToUser`, a message is sent directly as a reply to the subscription, via the
1308
- "clientOutboundChannel" channel. Effectively the subscription is used as a one-time,
1309
- request-reply message exchange with the subscription never stored. This is useful for
1310
- loading data on startup and for initializing a front-end UI.
1304
+ "clientOutboundChannel" channel. Effectively in this case the subscription is used as
1305
+ a one-time, request-reply message exchange with the subscription never stored.
1306
+ This is useful for loading data on startup and for initializing a front-end UI.
1311
1307
1312
1308
If an `@SubscribeMapping` method is annotated with `@SendTo` and `@SendToUser` the return
1313
1309
value is sent to the `"brokerChannel"` as usual, sending a message subscribers of the
0 commit comments