@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2021 the original author or authors .
* Copyright 2002 - 2022 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -24,6 +24,7 @@ import java.util.Map;
@@ -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,8 +150,10 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
@@ -149,8 +150,10 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
@Bean
public AbstractSubscribableChannel clientInboundChannel ( TaskExecutor clientInboundChannelExecutor ) {
ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel ( clientInboundChannelExecutor ) ;
public AbstractSubscribableChannel clientInboundChannel (
@Qualifier ( "clientInboundChannelExecutor" ) TaskExecutor executor ) {
ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel ( executor ) ;
channel . setLogger ( SimpLogging . forLog ( channel . getLogger ( ) ) ) ;
ChannelRegistration reg = getClientInboundChannelRegistration ( ) ;
if ( reg . hasInterceptors ( ) ) {
@ -185,8 +188,10 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
@@ -185,8 +188,10 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
}
@Bean
public AbstractSubscribableChannel clientOutboundChannel ( TaskExecutor clientOutboundChannelExecutor ) {
ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel ( clientOutboundChannelExecutor ) ;
public AbstractSubscribableChannel clientOutboundChannel (
@Qualifier ( "clientOutboundChannelExecutor" ) TaskExecutor executor ) {
ExecutorSubscribableChannel channel = new ExecutorSubscribableChannel ( executor ) ;
channel . setLogger ( SimpLogging . forLog ( channel . getLogger ( ) ) ) ;
ChannelRegistration reg = getClientOutboundChannelRegistration ( ) ;
if ( reg . hasInterceptors ( ) ) {
@ -221,13 +226,14 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
@@ -221,13 +226,14 @@ 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 executor ) {
MessageBrokerRegistry registry = getBrokerRegistry ( clientInboundChannel , clientOutboundChannel ) ;
ChannelRegistration registration = registry . getBrokerChannelRegistration ( ) ;
ExecutorSubscribableChannel channel = ( registration . hasTaskExecutor ( ) ?
new ExecutorSubscribableChannel ( brok erChannelE xecutor) : new ExecutorSubscribableChannel ( ) ) ;
new ExecutorSubscribableChannel ( executor ) : new ExecutorSubscribableChannel ( ) ) ;
registration . interceptors ( new ImmutableMessageChannelInterceptor ( ) ) ;
channel . setLogger ( SimpLogging . forLog ( channel . getLogger ( ) ) ) ;
channel . setInterceptors ( registration . getInterceptors ( ) ) ;
@ -366,10 +372,10 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
@@ -366,10 +372,10 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
@Bean
@Nullable
public AbstractBrokerMessageHandler stompBrokerRelayMessageHandler ( AbstractSubscribableChannel clientInboundChannel ,
AbstractSubscribableChannel clientOut boundChannel , AbstractSubscribableChannel broker Channel,
UserDestinationMessageHandler userDestinationMessageHandler , @Nullable MessageHandler userRegistry MessageHandler,
UserDestinationResolver userDestinationResolver ) {
public AbstractBrokerMessageHandler stompBrokerRelayMessageHandler (
AbstractSubscribableChannel clientIn boundChannel , AbstractSubscribableChannel clientOutbound Channel,
AbstractSubscribableChannel brokerChannel , UserDestinationMessageHandler userDestination MessageHandler,
@Nullable MessageHandler userRegistryMessageHandler , UserDestinationResolver userDestinationResolver ) {
MessageBrokerRegistry registry = getBrokerRegistry ( clientInboundChannel , clientOutboundChannel ) ;
StompBrokerRelayMessageHandler handler = registry . getStompBrokerRelay ( brokerChannel ) ;
@ -411,7 +417,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
@@ -411,7 +417,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
public MessageHandler userRegistryMessageHandler (
AbstractSubscribableChannel clientInboundChannel , AbstractSubscribableChannel clientOutboundChannel ,
SimpUserRegistry userRegistry , SimpMessagingTemplate brokerMessagingTemplate ,
TaskScheduler messageBrokerTaskS cheduler) {
@Qualifier ( "messageBrokerTaskScheduler" ) TaskScheduler s cheduler) {
MessageBrokerRegistry brokerRegistry = getBrokerRegistry ( clientInboundChannel , clientOutboundChannel ) ;
if ( brokerRegistry . getUserRegistryBroadcast ( ) = = null ) {
@ -420,7 +426,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
@@ -420,7 +426,7 @@ public abstract class AbstractMessageBrokerConfiguration implements ApplicationC
Assert . isInstanceOf ( MultiServerUserRegistry . class , userRegistry , "MultiServerUserRegistry required" ) ;
return new UserRegistryMessageHandler ( ( MultiServerUserRegistry ) userRegistry ,
brokerMessagingTemplate , brokerRegistry . getUserRegistryBroadcast ( ) ,
me ssageBrokerTaskS cheduler) ;
scheduler ) ;
}
// Expose alias for 4.1 compatibility