Spring integration GlobalChannelInterceptor传递模式数组
我是Spring Integration 4.3.13,在配置@GlobalChannel Interceptor时尝试传递模式 这是一个例子Spring integration GlobalChannelInterceptor传递模式数组,spring-integration,Spring Integration,我是Spring Integration 4.3.13,在配置@GlobalChannel Interceptor时尝试传递模式 这是一个例子 @Configuration public class IntegrationConfig{ @Bean @GlobalChannelInterceptor(patterns = "${spring.channel.interceptor.patterns:*}") public ChannelInterceptor channelIn
@Configuration
public class IntegrationConfig{
@Bean
@GlobalChannelInterceptor(patterns = "${spring.channel.interceptor.patterns:*}")
public ChannelInterceptor channelInterceptor(){
return new ChannelInterceptorImpl();
}
}
属性文件具有以下值:
spring.channel.interceptor.patterns=*intchannel,*event
我使用的是名称以这两个字符串结尾的直接通道
使用上述配置,两个通道都应该配置了拦截器,但未对其进行配置。当前不支持逗号分隔值 我同意,我们需要解决这个问题,所以请随时就此事提出JIRA,我们将从其他地方提交解决方案 同时,您可以将此作为解决方法:
@Bean
public GlobalChannelInterceptorWrapper channelInterceptorWrapper(@Value("${spring.channel.interceptor.patterns:*}") String[] patterns) {
GlobalChannelInterceptorWrapper globalChannelInterceptorWrapper = new GlobalChannelInterceptorWrapper(channelInterceptor());
globalChannelInterceptorWrapper.setPatterns(patterns);
return globalChannelInterceptorWrapper;
}