java - 如何在 Spring Integration 中使用路由器从单个类中拆分两个(对象和列表)
问题描述
集成流程:
@Bean
public IntegrationFlow sendFlow() {
return IntegrationFlows.from("intermediate-channel")
.log(LoggingHandler.Level.INFO, "RPO-I-0001: Error channel-channel", m
-> "date: " + ((ErrorHandler) m.getPayload()))
.route(GlobalErrorHandler.class,
p -> (p.isErrorFlowisNull()),
m -> m.channelMapping(Boolean.TRUE, "ErrorFlowChannel").channelMapping(Boolean.FALSE,
"nullChannel"))
.get();
}
(部分代码用于将错误列表移动到错误通道) 在 GlobalErrorHandler 类中,我有一个 NormalFlow 类和 errorFlow 列表的对象。现在,我如何使用 .route(GlobalErrorHandler.class) 拆分这两项,并且 normalFlow 应该移动到 normalFlowChannel 和 ,错误流列表应该移动到 errorFlowChannel 条件为 ,如果列表不为空,然后继续 erroFlowChannel否则离开它。
请帮帮我
解决方案
推荐阅读
- azure - 超大规模数据库上 New-AzSqlDatabaseCopy 的替代方案
- vue.js - 使用 Vue.JS 时,我们是否被迫在 CSP 中使用“unsafe-inline”?
- github - 从 GitHub 下载目录
- java - Android Studio Request App Permissions cant compile 显示错误:缺少数组维度
- c - 如何设置有理数小数展开的精度级别
- javascript - 反应钩子:无法更新功能组件内的状态
- python - 我应该怎么做才能使用烧瓶脚本连接到已经运行的烧瓶实例并在 ubuntu 的终端内单击
- java - 可运行的执行时间为每个 cron 滴答声两次
- javascript - 如何在带有 Javascript/node.js 的 SQL 语句中使用 MySQL 变量?
- java - 运行 docker image 时无法到达端点