You can use <onWhen> in the <onException> and use a predicate to check if you want to react or not. The GenericFileOperationFailedException ought to have a getCode / getReason() or something that returns the FTP error code.
On Mon, May 6, 2013 at 7:30 AM, sarfaraj <sarfarajsay...@gmail.com> wrote: > Hi, > > I am using camel-ftp (2.10.4) in my camel application(camel-route). > > If the ftp related error occured like wrong credential or incorrect IP then > it throws > "org.apache.camel.component.file.GenericFileOperationFailedException" > exception. > > I want to retry 3 times if FTP error occured, for that i added below code in > route file. > <onException> > > <exception>org.apache.camel.component.file.GenericFileOperationFailedException</exception> > <redeliveryPolicy maximumRedeliveries="3" redeliveryDelay="300000" /> > <onException> > > But what happen here I am also using <from uri="file:src/target" /> in same > file and in someof the case this code also throws the same > "org.apache.camel.component.file.GenericFileOperationFailedException" > exception. > > So my question is how do i differe both exception ? I want to retry if FTP > error occrrued else not. > > > /Sarfaraj > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Exception-handling-for-camel-ftp-tp5732051.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen