spring-integration - GlobalChannelInterceptor 传递模式数组
问题描述
我是 Spring Integration 4.3.13 并在配置 @GlobalChannelInterceptor 时尝试传递模式
这是示例
@Configuration
public class IntegrationConfig{
@Bean
@GlobalChannelInterceptor(patterns = "${spring.channel.interceptor.patterns:*}")
public ChannelInterceptor channelInterceptor(){
return new ChannelInterceptorImpl();
}
}
属性文件具有以下值:
spring.channel.interceptor.patterns=*intchannel,*事件
我正在使用名称以这两个字符串结尾的直接频道
- 弹簧通道
- 注册活动
使用上面的配置,两个通道都应该配置拦截器,但它没有被配置。
解决方案
目前不支持逗号分隔值。
我同意我们需要修复它,所以请随时就此事提出 JIRA,我们将从其他地方提交解决方案。
同时,您可以将其作为一种解决方法:
@Bean
public GlobalChannelInterceptorWrapper channelInterceptorWrapper(@Value("${spring.channel.interceptor.patterns:*}") String[] patterns) {
GlobalChannelInterceptorWrapper globalChannelInterceptorWrapper = new GlobalChannelInterceptorWrapper(channelInterceptor());
globalChannelInterceptorWrapper.setPatterns(patterns);
return globalChannelInterceptorWrapper;
}
推荐阅读
- python - 将 Python 版本 3.7 降级到 3.6
- python - 如何修改代码以实现输出“12333”?现在它输出 NONE
- ios - 如何通过 Objective-C 继承泛型类
- android - 如何使应用停止时停止的后台活动
- c# - c#表单关闭后Datagrid不更新
- javascript - 带有 Sass 的 Next.js 出现错误提示“您可能需要适当的加载程序来处理此文件类型错误”
- amazon-redshift - Redshift:语法检查实用程序
- javascript - 在基于时间的动画中取消运动的逻辑
- excel - VBA 错误处理程序未在错误处理程序中检测到错误
- python - 使用 if else 条件更新 pandas 数据框值?