You can either use noop=true and have your route move the file after done processing, or you could try adding an onComplete() that moves the file from the error folder back into the original folder.
On Thu, Aug 18, 2022 at 12:27 AM Alexander Lex <alexander....@ams-osram.com.invalid> wrote: > Hi, > > I am using the camel file component for an inbox processing software. > > Files are read, parsed, enriched with metadata from an external service > and finally moved to an output folder. > > When there is an exception with parsing the files, "moveFailed" is moving > the files to an error folder. > > When there is an exception when calling the external service in a > subroutine (from(direct)), I do not want the file to be moved to the error > folder. Camel shall shutdown and leave the file where it is. > > I tried with "onException" and a dedicated Processor where I call > "exchange.getContext().shutdown()", but this will finally executed the > callback an rollback to "moveFailed" > > The only way I got it working was with "System.exit(-1)". This does not > seem very clean to me. > > Do you know a way to intercept the "onCompletion onFailure" of the file > component? > > Thank you! > > Kind regards > > Alexander Lex >