org.springframework.web.socket.config.annotation

## Class WebSocketMessageBrokerConfigurationSupport

- java.lang.Object
- - org.springframework.messaging.simp.config.AbstractMessageBrokerConfiguration
  - - org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurationSupport

- All Implemented Interfaces:
    Aware, ApplicationContextAware
  Direct Known Subclasses:
    DelegatingWebSocketMessageBrokerConfiguration

      public abstract class WebSocketMessageBrokerConfigurationSupport
      extends AbstractMessageBrokerConfiguration

  Extends `AbstractMessageBrokerConfiguration` and adds configuration for receiving and responding to STOMP messages from WebSocket clients.

  Typically used in conjunction with `@EnableWebSocketMessageBroker` but can also be extended directly.

  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `WebSocketMessageBrokerConfigurationSupport()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `configureWebSocketTransport(WebSocketTransportRegistration registry)`
    `protected WebSocketTransportRegistration` | `getTransportRegistration()`
    `ThreadPoolTaskScheduler` | `messageBrokerSockJsTaskScheduler()` The default TaskScheduler to use if none is configured via `SockJsServiceRegistration.setTaskScheduler(org.springframework.scheduling.TaskScheduler)`, i.e.
    `protected abstract void` | `registerStompEndpoints(StompEndpointRegistry registry)`
    `HandlerMapping` | `stompWebSocketHandlerMapping()`
    `WebSocketHandler` | `subProtocolWebSocketHandler()`

    - ### Methods inherited from class org.springframework.messaging.simp.config.AbstractMessageBrokerConfiguration

      `brokerChannel, brokerChannelExecutor, brokerMessageConverter, brokerMessagingTemplate, clientInboundChannel, clientInboundChannelExecutor, clientOutboundChannel, clientOutboundChannelExecutor, configureClientInboundChannel, configureClientOutboundChannel, configureMessageBroker, configureMessageConverters, getApplicationContext, getBrokerRegistry, getClientInboundChannelRegistration, getClientOutboundChannelRegistration, getValidator, setApplicationContext, simpAnnotationMethodMessageHandler, simpleBrokerMessageHandler, simpValidator, stompBrokerRelayMessageHandler, userDestinationMessageHandler, userDestinationResolver, userSessionRegistry`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WebSocketMessageBrokerConfigurationSupport

          protected WebSocketMessageBrokerConfigurationSupport()

  - ### Method Detail

    - #### stompWebSocketHandlerMapping

          @Bean
          public HandlerMapping stompWebSocketHandlerMapping()

    - #### subProtocolWebSocketHandler

          @Bean
          public WebSocketHandler subProtocolWebSocketHandler()

    - #### getTransportRegistration

          protected final WebSocketTransportRegistration getTransportRegistration()

    - #### configureWebSocketTransport

          protected void configureWebSocketTransport(WebSocketTransportRegistration registry)

    - #### messageBrokerSockJsTaskScheduler

          @Bean
          public ThreadPoolTaskScheduler messageBrokerSockJsTaskScheduler()

      The default TaskScheduler to use if none is configured via `SockJsServiceRegistration.setTaskScheduler(org.springframework.scheduling.TaskScheduler)`, i.e.

           @Configuration
           @EnableWebSocketMessageBroker
           public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {

             public void registerStompEndpoints(StompEndpointRegistry registry) {
               registry.addEndpoint("/stomp").withSockJS().setTaskScheduler(myScheduler());
             }

             // ...

           }

    - #### registerStompEndpoints

          protected abstract void registerStompEndpoints(StompEndpointRegistry registry)