Its the chicken and egg. The Camel error handler does normally only
trigger if a message has been consumed.
Now you have the consumer fail before it can route a message into the
Camel route.

You can use a custom poll strategy, see details here
http://camel.apache.org/file2

And from Camel 2.10 onwards you can enable this option on the consumer
consumer.bridgeErrorHandler

And then it allows to trigger the Camel error handler.


On Wed, Mar 20, 2013 at 7:20 AM, sarfaraj <sarfarajsay...@gmail.com> wrote:
> Hi,
>
> I am using the sftp component(2.8.5). When I passed wrong credential or
> invalid IP, it doesn't throws any exception. That is why I could not
> recognized is connection established or not. Could someone tell me how to
> throw exception in such case.
>
> FYI: the route is
>
> <camel:camelContext xmlns="http://camel.apache.org/schema/spring";>
>
>                 <onException>
>                         <exception>java.lang.Exception</exception>
>                         <redeliveryPolicy maximumRedeliveries="1"
>                                 redeliveryDelay="0" />
>                         <continued>
>                                 <constant>true</constant>
>                         </continued>
>                         <log message="I am in exception."/>
>                 </onException>
>
>                 <route id="test1">
>
> <from
> uri="sftp://root@10.0.0.1//temp?password=test123&amp;throwExceptionOnConnectFailed=true&amp;noop=true";
> />
>
> <to uri="file:src/temp" />
> </route>
> </camel:camelContext>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/sftp-not-throwing-exception-tp5729470.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

Reply via email to