Reputation: 1845
I have 3 routes:
route-file1
which reads file1.csv
and converts to arrayroute-file2
which reads file2.csv
and converts to arrayroute-final
which uses enrich of both routes (with custom aggregator to merge arrays) and do somethingProblem is if route-file1
succeeds, but route-file2
or any other routes fail. route-file1
already completed and moved file1.csv
to .done
folder, so I cannot rerun everything again.
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. Is this possible with the camel?
Upvotes: 3
Views: 374
Reputation: 55555
You can set shareUnitOfWork
to true in your content-enricher's so they work together in the same unit of work. See more details in the documentation: http://camel.apache.org/content-enricher.html
Upvotes: 3