I am using Camel 2.3.0 - I have a file endpoint that is configured with
delete=true and moveFailed=error.  Yet when an error occurs, it does not
move it to a failed directory, and instead keeps re-trying the exchange.

Here is a route that shows my setup:

public void configure() throws Exception {

onException().process(myErrorProcessor).to("mock:error");

from("file://c:\\input?delete=true&moveFailed=error").process(someProcessor).unmarshal().xstream().to("mock:result")

}

The processor just does a simple transformation - however I am feeding it
invalid XML so that the unmarshal will fail.  The error processor is
executed, but when it completes and sends its error message to "mock:error"
- the whole route starts again.

I removed the "delete=true" so it was just:
"file://c:\\input?moveFailed=error".  Then when an error occurs, it moves
the file to error subdirectory.  And the completed files go to ".camel".

I don't want to have to remove the completed files manually so I changed the
route to:

"file://c:\\input?delete=true"
Now - regardless of whether an exception occurs - the input file is deleted.

It seems to be that the combination of both "delete=true" and
"moveFailed=error" seems to cause the route to keep re-trying indefinately,
but on their own - they work exactly as advertised.

Is the delete=true supposed to only moved completed (successfully) files? 
The documentation only says it will delete them after they are processed
(doesn't say if they succeeded or not).

I added a handled(true) on my exception route - and then it just deletes the
file and never moves it to the error folder.

I can remove the delete=true and my process will do what I want - however
then I have to make a manual step later to delete the contents of the .camel
folder for the ones that did work.  And I don't want to do that, seems to me
the delete=true should handle that.

Jonathan 
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-2-3-0-File-Endpoint-with-delete-true-and-moveFailed-doesn-t-move-failed-files-tp511964p511964.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to