Anshuraj
Anshuraj

Reputation: 1

How to Mark Files to .ERROR Once The File Processsing is Failed and Exception Happened

I want to mark the .csv file as .ERROR once the file processing is failed in the Apache Camel.

Some exception has occurred in the processing logic of the Apache Camel, so need to mark that file as .ERROR (un-processable file)

I am giving ?noop=true&exclude=.*.ERROR&moveFailed=/tmp/test in the configuration parameter.

String operation="?noop=true&exclude=.*.ERROR&moveFailed=/tmp/test1";

First of all, the file with exception is not getting moved.

Second, I am not getting as how to change the extension from .csv to .ERROR using Apache Camel once the file processing throws exception.

Any suggestion on it?

Upvotes: 0

Views: 82

Answers (1)

Claus Ibsen
Claus Ibsen

Reputation: 55525

You can specify this in moveFailed where you can move and rename, see the file language docs at: https://github.com/apache/camel/blob/master/docs/user-manual/modules/ROOT/pages/file-language.adoc

moveFailed=/tmp/test1/${file:name}.ERROR

Upvotes: 1

Related Questions