use of org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler in project spring-framework by spring-projects.
the class AbstractMessageBrokerConfiguration method stompBrokerRelayMessageHandler.
@Bean
public AbstractBrokerMessageHandler stompBrokerRelayMessageHandler() {
StompBrokerRelayMessageHandler handler = getBrokerRegistry().getStompBrokerRelay(brokerChannel());
if (handler == null) {
return new NoOpBrokerMessageHandler();
}
Map<String, MessageHandler> subscriptions = new HashMap<>(1);
String destination = getBrokerRegistry().getUserDestinationBroadcast();
if (destination != null) {
subscriptions.put(destination, userDestinationMessageHandler());
}
destination = getBrokerRegistry().getUserRegistryBroadcast();
if (destination != null) {
subscriptions.put(destination, userRegistryMessageHandler());
}
handler.setSystemSubscriptions(subscriptions);
return handler;
}
use of org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler in project spring-framework by spring-projects.
the class WebSocketMessageBrokerConfigurationSupport method webSocketMessageBrokerStats.
@Bean
public WebSocketMessageBrokerStats webSocketMessageBrokerStats() {
AbstractBrokerMessageHandler relayBean = stompBrokerRelayMessageHandler();
StompBrokerRelayMessageHandler brokerRelay = (relayBean instanceof StompBrokerRelayMessageHandler ? (StompBrokerRelayMessageHandler) relayBean : null);
// Ensure STOMP endpoints are registered
stompWebSocketHandlerMapping();
WebSocketMessageBrokerStats stats = new WebSocketMessageBrokerStats();
stats.setSubProtocolWebSocketHandler((SubProtocolWebSocketHandler) subProtocolWebSocketHandler());
stats.setStompBrokerRelay(brokerRelay);
stats.setInboundChannelExecutor(clientInboundChannelExecutor());
stats.setOutboundChannelExecutor(clientOutboundChannelExecutor());
stats.setSockJsTaskScheduler(messageBrokerTaskScheduler());
return stats;
}
Aggregations