简体   繁体   English

将例外传播给充实路线

[英]Propagate exception to enriching routes

I have 3 routes: - route-file1 which reads file1.csv and converts to array - route-file2 which reads file2.csv and converts to array - route-final which uses enrich of both routes (with custom aggregator to merge arrays) and do something 我有3条路由:-读取file1.csv并转换为数组的route-file1-读取file2.csv并转换为数组的route-file2-使用两个路由的充实(通过自定义聚合器合并数组)的route-final做一点事

Problem is if route-file1 succeeds, but route-file2 or any other routes fail. 问题是route-file1成功,但route-file2或其他任何路由失败。 route-file1 already completed and moved file1.csv to .done folder, so I cannot rerun everything again. route-file1已经完成,并将file1.csv移至.done文件夹,所以我无法再次运行所有内容。

Is there a way that when route-final fails, it propagates exception to other routes used in enrich? 有没有一种方法可以在路由最终失败时将异常传播到其他用于填充的路由? I tried using transaction which works fine with stopping the route execution, but does not propagate exception to the route-fileX routes. 我尝试使用事务处理,该事务可以很好地停止路由执行,但不会将异常传播到route-fileX路由。 Is this possible with the camel? 骆驼有可能吗?

You can set shareUnitOfWork to true in your content-enricher's so they work together in the same unit of work. 您可以在内容增强器中将shareUnitOfWork设置为true,以便它们在同一工作单元中一起工作。 See more details in the documentation: http://camel.apache.org/content-enricher.html 请参阅文档中的更多详细信息: http : //camel.apache.org/content-enricher.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM