xml - Apache骆驼多个端点
问题描述
我做了一个 sql 选择并将数据保存在 CSV 中。在这里,我想做的是将 sql 结果发送到两个端点。
我正在使用骆驼版本 2.12.3
我尝试了多播,但它不适用于第二个端点。我只有第一个文件中的 sql 结果,而不是第二个文件
<to uri="sql:{{export.select.query}}?dataSource=selectDataSource" />
<marshal>
<csv autogenColumns="true" delimiter="|" />
</marshal>
<multicast stopOnException="true">
<to uri="file:{{export.select.dir}}?fileName=${property.exportSelectFileName}_exportSelect.csv&charset=utf-8" />
<to uri="file:{{export.select_2.dir}}?fileName=exportSelect_${property.exportSelectFileName}.csv&charset=utf-8&fileExist=Append" />
</multicast>
你有其他建议吗?否则有没有可能用 groovy 来做呢?
解决方案
我在下面找到了它,它对我来说很好用
<recipientList>
<constant>file:{{export.select.dir}}?fileName=${property.exportSelectFileName}_exportSelect.csv&charset=utf-8,file:{{export.select_2.dir}}?fileName=exportSelect_${property.exportSelectFileName}.csv&charset=utf-8&fileExist=Append </constant>
</recipientList>
推荐阅读
- pandas - 在循环熊猫中添加列
- git - git:你怎么能在 git-status 中使用 `R`、`C` 和 `U` 标志
- node.js - 我怎么打电话
Firebase 云函数中的 .listCollections()? - php - antergos 从 htaccess 切换到 php 7.0
- javascript - 反应:在从另一个组件调用的函数中使用 setState?
- java - 使用 Spring Boot 处理大型 zip 文件
- javascript - Aspx 中的脚本管理器
- angular - ng:错误:尝试将上下文传递到 ComponentPortal 时无法解析组件的所有参数
- python - Tuple() vs () 用于元组理解和元组创建
- javascript - 从最后一行查找数据