camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From turp1twin <jeff.tur...@ecloser.net>
Subject Error Handling
Date Mon, 11 May 2009 23:30:25 GMT

I am new to Camel and am having a tough time getting my route to work
properly. That being said, it is entirely possible that I am being a moron
and have missed something simple.... However, I have searched the mailing
list and have not found the answer I am looking for. Any help would be
appreciated. I am using Camel 2.0-M1 and I am trying to test my various
error handling scenarios. I am using a Java DSL with various endpoints
configured in my Spring camel-context.xml.

Endpoints:

<camel:endpoint id="filePollingDir"
uri="file:///Users/xxxxx/temp/polldir/"/>

<camel:endpoint id="sFtpDestination"
                   
uri="sftp://R098697@sftp.someserver.com/upload?password=xxxxxx&amp;knownHostsFile=/Users/xxxxx/.ssh/known_hosts"/>
        
<camel:endpoint id="failedTransferSmtp"
uri="smtp://smtp.someserver.net?to=user@mymail.net&amp;from=admin@mymail.net"/>

Route definition:
      
from(getEndpoint("filePollingDir")).onException(Exception.class).maximumRedeliveries(0).handled(true).end()
   
.to(getEndpoint("sFtpDestination")).onException(Exception.class).maximumRedeliveries(2).handled(true)
.to(getEndpoint("failedTransferSmtp")).onException(Exception.class).maximumRedeliveries(0).handled(true).end();


Basically what I am trying to achieve is that if the SFTP producer fails I
want to send an email notifying a user that the transfer failed. I also want
to handle the case where the smtp producer might also fail. I am getting to
the SMTP endpoint (failedTransferSmtp) just fine, however, when it fails (as
intended for this particular test) it causes the "filePollingDir" consumer
to rollback and consume the source file again. This continues in a loop...
Is this behavior intended? If so, can I configure the consumer to stop
consuming the same file again? Again, I might be missing something simple,
but any help would be appreciated. Cheers!

Jeff



-- 
View this message in context: http://www.nabble.com/Error-Handling-tp23493625p23493625.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message