spring-cloud-stream - 如何使 Spring Cloud Stream 中流中未处理异常的控制台输出静音?
问题描述
使用 Spring Cloud Stream 和 Kafka binder,我有一个非常简单的处理器绑定到 SI 流:
@Bean
@Autowired
public IntegrationFlow inputFlow(Thrower thrower) {
return IntegrationFlows
.from(ApplicationBinding.INPUT)
.handle(thrower))
.channel("nullChannel")
.get()
}
thrower
bean 只是抛出RuntimeException
一个.
RuntimeException
似乎被 a 包裹并MessageProcessingException
转储到控制台。
如何使该控制台输出静音并保持所有其他行为相同?
我已经配置spring.cloud.stream.bindings.error.destination=errorChannel
但绑定一个处理程序(像这样)似乎没有让我玩任何事件:
@ServiceActivator(inputChannel = "errorChannel")
public void errors(ErrorMessage em) {
log.info("Heyooo {}", em);
}
解决方案
推荐阅读
- python - 如何修复“DataLossError : Unable to open table file .\checkpoints: NewRandomAccessFile failed to Create/Open: .\checkpoints : Access is denied”?
- python - 如何在堆积条形图显示中抑制零
- reactjs - 如何将数组中的元素放入输入中
- powershell - 使用 Powershell 登录网站 - 缺少单击方法
- python - 分类时出现名为 dense_4 的错误(CNN)
- unit-testing - 从测试中访问 perl modulino 中的全局变量
- swift - 是否可以有不用作参数的参数?
- powershell - Powershell 多个动态按钮
- rebus - 从数据库恢复消息
- reactjs - 如何在 i18next 配置中使用 cookie?