Hi You need to move the filter from the route up to the file endpoint so its applied sooner. See the filter option on the file componet https://github.com/apache/camel/blob/master/camel-core/src/main/docs/file-component.adoc
On Thu, Mar 23, 2017 at 8:51 PM, Hari <[email protected]> wrote: > Hi, > > I am new to camel. I have a requirement to move XML files from one directory > to another based on some conditions in the content of the XML file. > > Here is how the route i wrote looks like. The StatusFilter, returns true or > false , based on the condition. When the condition is not met, I need the > file to remain in the source folder. The below route does not move the file > when the filter returns false, which is exactly what i want, but it is > moving the file to .camel folder. > > Need help to retain the file in the source folder, when the condition is not > met. Tried noop and delete options, but it did not work. > > from("file:d:\\data\\inprocess?recursive=true").convertBodyTo(String.class).filter().method(new > StatusFilter(), "filter"). > process(new Processor() { > public void process(Exchange exchange) throws Exception { > .... > .. > } > }). > to("file:d:\\data\\register\\completed"); > > > Please help. > Regards, > Hari > > > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Need-help-retaining-files-in-source-folder-tp5796053.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
