Qualify channelExecutor and taskScheduler in WebSocket config
See gh-28736
This commit is contained in:
parent
d1d6eb095e
commit
461ba53b39
|
|
@ -24,6 +24,7 @@ import java.util.Map;
|
|||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.BeanInitializationException;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
|
@ -149,7 +150,8 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
|
|||
|
||||
|
||||
@Bean
|
||||
public AbstractSubscribableChannel clientInboundChannel(TaskExecutor clientInboundChannelExecutor) {
|
||||
public AbstractSubscribableChannel clientInboundChannel(
|
||||
@Qualifier("clientInboundChannelExecutor") TaskExecutor clientInboundChannelExecutor) {
|
||||
ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel(clientInboundChannelExecutor);
|
||||
channel.setLogger(SimpLogging.forLog(channel.getLogger()));
|
||||
ChannelRegistration reg = getClientInboundChannelRegistration();
|
||||
|
|
@ -185,7 +187,8 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
|
|||
}
|
||||
|
||||
@Bean
|
||||
public AbstractSubscribableChannel clientOutboundChannel(TaskExecutor clientOutboundChannelExecutor) {
|
||||
public AbstractSubscribableChannel clientOutboundChannel(
|
||||
@Qualifier("clientOutboundChannelExecutor") TaskExecutor clientOutboundChannelExecutor) {
|
||||
ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel(clientOutboundChannelExecutor);
|
||||
channel.setLogger(SimpLogging.forLog(channel.getLogger()));
|
||||
ChannelRegistration reg = getClientOutboundChannelRegistration();
|
||||
|
|
@ -221,8 +224,9 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
|
|||
}
|
||||
|
||||
@Bean
|
||||
public AbstractSubscribableChannel brokerChannel(AbstractSubscribableChannel clientInboundChannel,
|
||||
AbstractSubscribableChannel clientOutboundChannel, TaskExecutor brokerChannelExecutor) {
|
||||
public AbstractSubscribableChannel brokerChannel(
|
||||
AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel,
|
||||
@Qualifier("brokerChannelExecutor") TaskExecutor brokerChannelExecutor) {
|
||||
|
||||
MessageBrokerRegistry registry = getBrokerRegistry(clientInboundChannel, clientOutboundChannel);
|
||||
ChannelRegistration registration = registry.getBrokerChannelRegistration();
|
||||
|
|
@ -411,7 +415,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
|
|||
public MessageHandler userRegistryMessageHandler(
|
||||
AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel,
|
||||
SimpUserRegistry userRegistry, SimpMessagingTemplate brokerMessagingTemplate,
|
||||
TaskScheduler messageBrokerTaskScheduler) {
|
||||
@Qualifier("messageBrokerTaskScheduler") TaskScheduler messageBrokerTaskScheduler) {
|
||||
|
||||
MessageBrokerRegistry brokerRegistry = getBrokerRegistry(clientInboundChannel, clientOutboundChannel);
|
||||
if (brokerRegistry.getUserRegistryBroadcast() == null) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.springframework.web.socket.config.annotation;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.config.CustomScopeConfigurer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
|
@ -129,8 +130,10 @@ public abstract class WebSocketMessageBrokerConfigurationSupport extends Abstrac
|
|||
@Bean
|
||||
public WebSocketMessageBrokerStats webSocketMessageBrokerStats(
|
||||
@Nullable AbstractBrokerMessageHandler stompBrokerRelayMessageHandler,
|
||||
WebSocketHandler subProtocolWebSocketHandler, TaskExecutor clientInboundChannelExecutor,
|
||||
TaskExecutor clientOutboundChannelExecutor, TaskScheduler messageBrokerTaskScheduler) {
|
||||
WebSocketHandler subProtocolWebSocketHandler,
|
||||
@Qualifier("clientInboundChannelExecutor") TaskExecutor clientInboundChannelExecutor,
|
||||
@Qualifier("clientOutboundChannelExecutor") TaskExecutor clientOutboundChannelExecutor,
|
||||
@Qualifier("messageBrokerTaskScheduler") TaskScheduler messageBrokerTaskScheduler) {
|
||||
|
||||
WebSocketMessageBrokerStats stats = new WebSocketMessageBrokerStats();
|
||||
stats.setSubProtocolWebSocketHandler((SubProtocolWebSocketHandler) subProtocolWebSocketHandler);
|
||||
|
|
|
|||
Loading…
Reference in New Issue