【发布时间】:2020-09-02 14:40:11
【问题描述】:
我执行 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 做到这一点?
【问题讨论】:
-
如果您不需要并行导出,也可以完全删除多播。
标签: xml groovy apache-camel spring-camel