I tried with a new approach it works atleast for basic condition . But the problem is if there is any file left in the folder which did not match in the Run , the route keeps on polling and the filter is called everytime .
1) Is there any way in which the route can be told to stop pooling after subsequent polls which did not result any file processing. 2) There could be a gap in the sequence, i.e. after 2 , 4 can be the next file how can i come to know that the route has finished processing one cylce, so that I can increment again in filter and the route will work again. 3) Incase there is a file les than sequence or any junk file , it should be moved to different folder. Since I am using a Filter , not sure if that can be done . I can configure a different route to counter this. <route shutdownRunningTask="CompleteCurrentTaskOnly" id="RouteFilter" > <from uri="timer://foo?period=2h"/> <to uri="controlbus:route?routeId=UserCSVToDB&action=start" /> </route> <route shutdownRunningTask="CompleteCurrentTaskOnly" id="UserCSVToDB" autoStartup="false"> <from uri="file:///C:\FS\processing\?readLock=true&move=C:\FS\complete&filter=#filterDS&charset=utf-8"/> <setHeader headerName="sourcename"> <simple>DS</simple> </setHeader> <setHeader headerName="fileseq"> <method ref="DatabaseBean" method="getSequence(${header.sourcename})" /> </setHeader> <split streaming="true"> <tokenize token="\n"></tokenize> <unmarshal> <csv/> </unmarshal> <log message="The message contains ${body}"/> </split> <to uri="bean:DatabaseBean?method=updateSequence(${header.sourcename},${header.fileseq})"/> </route> -- View this message in context: http://camel.465427.n5.nabble.com/Camel-file-component-URI-dynamic-options-Filter-query-tp5776861p5777107.html Sent from the Camel - Users mailing list archive at Nabble.com.