You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by skippi1 <sk...@gmx.de> on 2015/11/28 09:20:54 UTC

Route multithreading

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.

Re: Route multithreading

Posted by yogu13 <yo...@gmail.com>.
After the <to uri="some database..."> you can use a file producer component
which would be like <to uri="file://filename?fileExist=Move/>

Regards,
-Yogesh




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