Klaus Johansen <kljohan...@gmail.com> writes:
> Hi all, > > I have used a lot time configuring a deadLetterChannel errorHandler and a > custom PollingConsumerPollStrategy for our PollingConsumers (mostly sFTP > and FTPS). > > In combination with "throwExceptionOnConnectFailed=true" and > "consumer.bridgeErrorHandler=true" we have a generally robust setup, where > the Camel error-handler handles both consumer and producer errors. It does > redelivery and sends an alert when exhausted. This allows us to handle e.g. > connection timeouts to FTP servers in both consumer and producer in the > same controlled way. > > Recently we had several situations with FTP error code 150 (e.g. socket > timeouts) which ends up in an org.apache.camel.component.file. > GenericFileOperationFailedException. > > Similar if the FTP server replies with "550 File not found, access denied." > it results in the following exception: > > org.apache.camel.component.file.GenericFileOperationFailedException: Cannot > retrieve file: RemoteFile[TestFil.XML] from: Endpoint[ftp://127.0.0.1:21/? > autoCreate=false&binary=true&consumer.bridgeErrorHandler= > true&delete=true&disconnect=true&doneFileName=%24%7Bfile%3Aname%7D.SEM& > <ftp://127.0.0.1/?autoCreate=false&binary=true&consumer.bridgeErrorHandler=true&delete=true&disconnect=true&doneFileName=%24%7Bfile%3Aname%7D.SEM&> > include=%28%3Fi%29.*%5C.XML&localWorkDirectory=c%3A%5Ctest%5Cftpworkdir& > maximumReconnectAttempts=0&passiveMode=true&password=xxxxxx&pollStrategy=% > 23poll30times&readLock=none&reconnectDelay=240000& > scheduler=spring&scheduler.cron=30+*+*+*+*+MON-FRI&stepwise=false& > throwExceptionOnConnectFailed=true&username=testuser] > > According to the log, the GenericFileOperationFailedException is directly > followed by the configured "onPrepareFailure" processor and then handled by > the "FatalFallbackErrorHandler". As a result the "commit" method of the > custom PollingConsumerPollStrategy is invoked and no redelivery attempted. > > Is GenericFileOperationFailedException handled differently by the Camel > Error Handler than other exceptions? - Or is it a bug? > > If working as designed: Can I somehow configure an onException section or > something different to override this behaviour? > > I'm currently using camel 2.17.3. > > Best regards, > Klaus