相关文章推荐
道上混的椅子  ·  梁珀華老師簡介·  3 周前    · 
犯傻的毛衣  ·  vba窗体嵌入表格-掘金·  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