A route does file processing. It reads file contents does some processing and
stores the contents into a database. Including error handling this is a well
documented feature of apache camel. For performance I want to use multipe
threads, but how to handle error if a single thread fails within the same
route?

My requirements are:
1. A file will be deleted, after successful write to database (commited)
2. Bulk database operations are required: multiple contents are aggregated
into an single write request.

<route>
   <from uri="file:..."/>
   <threads ...>
    ... doing single file processing here
   <aggregation ...>
   <to uri="some database"/>
</route>

Question:
How to connect file deletion with database commit? E.g. there are 5 parallel
threads doing processing, but for bulk operation I want to collect 100
messages (or wait 20 seconds). If database commit fails the files shall be
left in file system. If a single file fails it may be routed to DLQ and file
is removed, but all others should be commited.
Probably there is an easy solution, but I cannot find any example.

Any idea?

Markus




--
View this message in context: 
http://camel.465427.n5.nabble.com/Route-multithreading-tp5774510.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to