Sql timeout. Camel-context Bean fails for multiple files -
i run automatic route when files dropped in folder
<route id ="automatic-route"> <from uri="file:c:/pathtofolder?noop=true"/> <to uri="bean:automaticbean"/> <to uri="activemq:startflow.q"/> </route>
i move file in subfolder called "done" java methods in bean automaticbean.java.
then start route process file.
<route id ="process-route"> <from uri="direct:process"/> <to uri="bean:processbean"/> </route>
when move multiple files in folder correctly moved subfolder (through bean. use java method move them). second bean (file processing , sql queries) has timeoutexception because files moved , processed @ same time.
for example when move 5 files 3 of them correctly processed last ones have timeoutexception. possible run second route each files 1 one (schedule them or that)? , start second route file when previous file correctly processed?
i tried noop=false;move=done , have infinite loop problems , cannot process files because moved. that's why use noop=true. furthermore problem second route (the files correctly moved).
thanks.
one solution can poll /done
folder new files (which have been processed , moved automaticbean
). in case have use readlock
or donefilename
check if file isn't locked process.
<route id ="process-route"> <from uri="file:c:/pathtofolder/done?readlock=changed"/> <to uri="bean:processbean"/> </route>
Comments
Post a Comment