public abstract class WebSocketMessageBrokerConfigurationSupport extends AbstractMessageBrokerConfiguration
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.
| Modifier | Constructor and Description |
|---|---|
protected |
WebSocketMessageBrokerConfigurationSupport() |
| 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() |
brokerChannel, brokerChannelExecutor, brokerMessageConverter, brokerMessagingTemplate, clientInboundChannel, clientInboundChannelExecutor, clientOutboundChannel, clientOutboundChannelExecutor, configureClientInboundChannel, configureClientOutboundChannel, configureMessageBroker, configureMessageConverters, getApplicationContext, getBrokerRegistry, getClientInboundChannelRegistration, getClientOutboundChannelRegistration, getValidator, setApplicationContext, simpAnnotationMethodMessageHandler, simpleBrokerMessageHandler, simpValidator, stompBrokerRelayMessageHandler, userDestinationMessageHandler, userDestinationResolver, userSessionRegistryprotected WebSocketMessageBrokerConfigurationSupport()
@Bean public HandlerMapping stompWebSocketHandlerMapping()
@Bean public WebSocketHandler subProtocolWebSocketHandler()
protected final WebSocketTransportRegistration getTransportRegistration()
protected void configureWebSocketTransport(WebSocketTransportRegistration registry)
@Bean public ThreadPoolTaskScheduler messageBrokerSockJsTaskScheduler()
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());
}
// ...
}
protected abstract void registerStompEndpoints(StompEndpointRegistry registry)