You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "kartik kudada (JIRA)" <ji...@apache.org> on 2014/01/02 18:27:55 UTC

[jira] [Comment Edited] (CAMEL-7084) pollEnrich with throwExceptionOnConnectFailed=true & move=../Done/

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

kartik kudada edited comment on CAMEL-7084 at 1/2/14 5:26 PM:
--------------------------------------------------------------

Hi,
Thanks for reply.
I checked the logs and found the same as you have mentioned above.
I am sorry , i have not provided exception handling part which was there in my code.
So here is the full snipped with exception handling. As per the snipped, mail should be gone as soon as Exception is caught but it does not. 
Same code is working fine if SFTP server is used as destination, but when i use SFTP server as source it does not throw exception as desired.  
Please let me know if i am mistaking anything. 

<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"/>
<onException>
                <exception>java.lang.Exception</exception>
                <transform>
                    <simple>Exception while transferring file: ${exception.message}\n\n${exception.stacktrace}
                    </simple>
                </transform>
                <to uri="smtp://{{{{mail.host}}}}?from={{{{mail.from}}}}&amp;to={{{{mail.to}}}}&amp;subject={{{{mail.subject.environment}}}}  File Transferring File "/>
            </onException>
</route>
 


was (Author: kartik.kudada):
Hi,
Thanks for reply.
I checked the logs and found the same as you have mentioned above.
I am sorry , i have not provided exception handling part which was there in my code.
So here is the full snipped with exception handling. As per the snipped, mail should be gone as soon as Exception is caught but it does not. 
Same code is working fine if SFTP server is used as destination, but when i use SFTP server as source it does not throw exception as desired.  
Please let me know if i am mistaking anything. 

<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"/>
<onException>
                <exception>java.lang.Exception</exception>
                <transform>
                    <simple>Exception while transferring file: ${exception.message}\n\n${exception.stacktrace}
                    </simple>
                </transform>
                <to uri="smtp://{{mail.host}}?from={{mail.from}}&amp;to={{mail.to}}&amp;subject={{mail.subject.environment}}  File Transferring File "/>
            </onException>
</route>
 

> 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)