On Mon, Feb 1, 2016 at 6:08 PM, fxthomas <felix.tho...@gmail.com> wrote: > 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. >
You can use a route policy, with sendEmptyMessageWhenIdle=true, and then detect if its an empty file and stop the route. And mind you would need to filter the empty file in your route so you do not process the empty file. Also you can use the backoff to not poll so often when there is no files. So it wont poll so often, though its still running. > 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. You can add a callback to the exchange which gets called when its done / or use event notifier etc. > > 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. -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2