我的业务逻辑需要能够更改聚合器上配置的组超时。
代码如下所示:
@Autowired
AggregatingMessageHandler messageAggregator;
public void setTimeout(Integer timeoutValue) {
Expression timeoutExpression = new SpelExpressionParser().parseExpression(timeoutValue.toString());
messageAggregator.setGroupTimeoutExpression(timeoutExpression);
}
问题是:
- 我想向用户显示当前值,但是...
- 吸气剂受到保护。
可能的解决方案:
- 我应该在这个bean上注入一个表达式然后改变它的值吗?
- 意思是,它会在下次构建消息组时用新结果重新评估表达式?
- 我应该使用我自己的具有公共设置器的处理程序来扩展 AggregatingMessageHandler 吗?
- 或者这是一个错误,应该在下一个版本中修复?