相关文章推荐
不爱学习的手套  ·  Noop_百度百科·  1 年前    · 
讲道义的针织衫  ·  pyspark withcolumn ...·  1 年前    · 
体贴的柿子  ·  Deepin V20 ...·  1 年前    · 
豁达的木耳  ·  sql server join on 1=1-掘金·  2 年前    · 
@Target ( TYPE ) @Documented @Import ( DelegatingWebSocketMessageBrokerConfiguration.class ) public @interface EnableWebSocketMessageBroker
Add this annotation to an @Configuration class to enable broker-backed messaging over WebSocket using a higher-level messaging sub-protocol.
 @Configuration
 @EnableWebSocketMessageBroker
 public class MyWebSocketConfig {
 

Customize the imported configuration by implementing the WebSocketMessageBrokerConfigurer interface:

 @Configuration
 @EnableWebSocketMessageBroker
 public class MyConfiguration implements WebSocketMessageBrokerConfigurer {
     @Override
     public void registerStompEndpoints(StompEndpointRegistry registry) {
         registry.addEndpoint("/portfolio").withSockJS();
     @Override
     public void configureMessageBroker(MessageBrokerRegistry registry) {
         registry.enableStompBrokerRelay("/queue/", "/topic/");
         registry.setApplicationDestinationPrefixes("/app/");
Since:
Author:
Rossen Stoyanchev