INT-2501: Set CI#autoCreate from INT properties
JIRA: https://jira.springsource.org/browse/INT-2501
This commit is contained in:
@@ -47,6 +47,7 @@ import org.springframework.integration.channel.DefaultHeaderChannelRegistry;
|
||||
import org.springframework.integration.config.IntegrationEvaluationContextFactoryBean;
|
||||
import org.springframework.integration.config.xml.ChannelInitializer.AutoCreateCandidatesCollector;
|
||||
import org.springframework.integration.context.IntegrationContextUtils;
|
||||
import org.springframework.integration.context.IntegrationProperties;
|
||||
import org.springframework.integration.expression.IntegrationEvaluationContextAwareBeanPostProcessor;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -145,7 +146,10 @@ public abstract class AbstractIntegrationNamespaceHandler implements NamespaceHa
|
||||
alreadyRegistered = parserContext.getRegistry().isBeanNameInUse(CHANNEL_INITIALIZER_BEAN_NAME);
|
||||
}
|
||||
if (!alreadyRegistered) {
|
||||
BeanDefinitionBuilder channelDef = BeanDefinitionBuilder.genericBeanDefinition(ChannelInitializer.class);
|
||||
String channelsAutoCreateExpression = "#{@" +IntegrationContextUtils.INTEGRATION_PROPERTIES_BEAN_NAME +
|
||||
"['" + IntegrationProperties.CHANNELS_AUTOCREATE + "']}";
|
||||
BeanDefinitionBuilder channelDef = BeanDefinitionBuilder.genericBeanDefinition(ChannelInitializer.class)
|
||||
.addPropertyValue("autoCreate", channelsAutoCreateExpression);
|
||||
BeanDefinitionHolder channelCreatorHolder = new BeanDefinitionHolder(channelDef.getBeanDefinition(), CHANNEL_INITIALIZER_BEAN_NAME);
|
||||
BeanDefinitionReaderUtils.registerBeanDefinition(channelCreatorHolder, parserContext.getRegistry());
|
||||
}
|
||||
|
||||
@@ -26,4 +26,6 @@ public interface IntegrationProperties {
|
||||
|
||||
String LATE_REPLY_LOGGING_LEVEL = "messagingTemplate.lateReply.logging.level";
|
||||
|
||||
String CHANNELS_AUTOCREATE = "channels.autoCreate";
|
||||
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
channels.autoCreate=true
|
||||
messagingTemplate.lateReply.logging.level=warn
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<int:service-activator input-channel="inputChannel" expression="'hello'"/>
|
||||
|
||||
<bean id="ChannelInitializer" class="org.springframework.integration.config.xml.ChannelInitializer">
|
||||
<bean id="channelInitializer" class="org.springframework.integration.config.xml.ChannelInitializer">
|
||||
<property name="autoCreate" value="true"/>
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd">
|
||||
|
||||
<bean id="ChannelInitializer" class="org.springframework.integration.config.xml.ChannelInitializer">
|
||||
<bean id="channelInitializer" class="org.springframework.integration.config.xml.ChannelInitializer">
|
||||
<property name="autoCreate" value="true"/>
|
||||
</bean>
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
#channels.autoCreate=false
|
||||
messagingTemplate.lateReply.logging.level=error
|
||||
|
||||
Reference in New Issue
Block a user