注释类型 SubscribeMapping
@Target(METHOD) @Retention(RUNTIME) @Documented public @interface SubscribeMapping
Annotation for mapping subscription messages onto specific handler methods based on the destination of a subscription. Supported with STOMP over WebSocket only (e.g. STOMP SUBSCRIBE frame).This is a method-level annotation that can be combined with a type-level
@MessageMapping
.Supports the same method arguments as
@MessageMapping
; however, subscription messages typically do not have a body.The return value also follows the same rules as for
@MessageMapping
, except if the method is not annotated withSendTo
orSendToUser
, the message is sent directly back to the connected user and does not pass through the message broker. This is useful for implementing a request-reply pattern.NOTE: When using controller interfaces (e.g. for AOP proxying), make sure to consistently put all your mapping annotations - such as
@MessageMapping
and@SubscribeMapping
- on the controller interface rather than on the implementation class.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
- 另请参阅:
MessageMapping
,SendTo
,SendToUser
可选元素概要
可选元素 修饰符和类型 可选元�8/docs/api/java/lang/String.html?is-external=true" title="java.lang中的类或接口" class=externalLink>String[] value
Destination-based mapping expressed by this annotation.