[ 
https://issues.apache.org/jira/browse/CAMEL-7084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13860298#comment-13860298
 ] 

Rene Avontuur commented on CAMEL-7084:
--------------------------------------

I checked if I could write some missing unit test, but the use of 
throwExceptionOnConnectFailed is already well covered by 
FtpConsumerThrowExceptionOnLoginFailedTest.
The documentation on the use of throwExceptionOnConnectFailed  is also 
complete, but a bit minimalistic: 'This allows a custom pollStrategy to deal 
with the exception, for example to stop the consumer or the likes.' 
The name 'throwExceptionOnConnectFailed' might be misleading. An alternative 
name could be rollbackOnConnectFailed?

If no own pollstrategy is supplied, then DefaultPollingConsumerPollStrategy is 
used. The rollback method only returns a false.
The exception will be caught anyway, and handled by the 
LoggingExceptionHandler, which logs the exception as a warning.
In the log one should find something like:

2014-01-02 16:14:29,104 [:21000/badlogin] WARN  FtpConsumer                    
- Consumer 
FtpConsumer[ftp://dummy@localhost:21000/badlogin?password=xxxxxx&throwExceptionOnConnectFailed=true]
 failed polling endpoint: 
Endpoint[ftp://dummy@localhost:21000/badlogin?password=xxxxxx&throwExceptionOnConnectFailed=true].
 Will try again at next poll. Caused by: 
[org.apache.camel.component.file.GenericFileOperationFailedException - File 
operation failed: 530 Authentication failed.
. Code: 530]
org.apache.camel.component.file.GenericFileOperationFailedException: File 
operation failed: 530 Authentication failed.
. Code: 530
        at 
org.apache.camel.component.file.remote.FtpOperations.connect(FtpOperations.java:166)



> pollEnrich with throwExceptionOnConnectFailed=true & move=../Done/
> ------------------------------------------------------------------
>
>                 Key: CAMEL-7084
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7084
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-quartz
>    Affects Versions: 2.11.0
>            Reporter: kartik kudada
>
> Hi,
> I am very new in Camel, i am trying to create a polling mechanism where 
> application look for file at every 1 hour, if file is found it transfer to 
> destination. I have used spring DSL with quartz.
> For the polling every hour i am using pollEnrich . It is working fine and it 
> picks up file every hour and transfer it.
> But when i use throwExceptionOnConnectFailed and move options with 
> pollEnrich, it simply ignores it, because when i try with wrong username and 
> password, it does not throw any Exception and does not move processed file to 
> Done folder. 
> Below is the code snipped :-
> <route id="ABC">
>             <from uri="quartz://scheder/mytimer?cron=0+0+*+*+*+?"/>
>             <pollEnrich 
> uri="sftp://username:********@host/myfolder/?include=.***.dat&throwExceptionOnConnectFailed=true&move=../Done/*&moveFailed=../Exception/&stepwise=false&disconnect=true&delay=5000&idempotent=true&delete=true";
>  timeout="10000"/>
>                <to uri="{{destination-folder}}"/>
>         </route>
>  
>  
> Any inputs are highly appreciable.  



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to