You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Hilde <hi...@yahoo.de> on 2012/09/14 13:50:13 UTC

FTP-Consumer: Handle UnknowHostException

Hello everybody!

We have created a ftp consumer route dynamically as follow:



The thing is the configured endpoint cannot handle the situation if the ftp
host is not connectable. The route cannot stop 
because the onException section is not reached. The log file instead has
produced the following stack trace:



Can someone please explain me how the ftp consumer route can stopped if a
UnknowHostException was thrown? Actually I was 
convinced the endpoint options /maximumReconnectAttempts/ and
/throwExceptionOnConnectFailed/ would be in charge for that.

We are using Apache Camel 2.10.0

Cheers
Hilde




--
View this message in context: http://camel.465427.n5.nabble.com/FTP-Consumer-Handle-UnknowHostException-tp5719362.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: FTP-Consumer: Handle UnknowHostException

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Sep 18, 2012 at 3:54 PM, Claus Ibsen <cl...@gmail.com> wrote:
> On Tue, Sep 18, 2012 at 2:08 PM, Hilde <hi...@yahoo.de> wrote:
>> Hello Claus!
>>
>> Sorry for answering late.
>>
>> Yes, I have enabled the option /throwExceptionOnConnectFailed=true/
>> Is that ok?
>>
>
> Yeah that would be needed to allow the bridge error handler to react.
> You may also need to set maximumReconnectAttempts=0, so reconnection
> is not attempted.
>
> And you would need to implement a custom PollingConsumerPollStrategy,
> where you in the rollback throw the caused exception.
> Otherwise the bridge error handler cannot react.
>
> We may consider allowing to make this out of the box if you have
> bridgeErrorHandler enabled, as then the caused exception will routed
> in Camel and allow onException to trigger.
>

I logged a ticket about this
https://issues.apache.org/jira/browse/CAMEL-5638

>
>> Cheers
>> Hilde
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/FTP-Consumer-Handle-UnknowHostException-tp5719362p5719523.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: FTP-Consumer: Handle UnknowHostException

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Sep 18, 2012 at 2:08 PM, Hilde <hi...@yahoo.de> wrote:
> Hello Claus!
>
> Sorry for answering late.
>
> Yes, I have enabled the option /throwExceptionOnConnectFailed=true/
> Is that ok?
>

Yeah that would be needed to allow the bridge error handler to react.
You may also need to set maximumReconnectAttempts=0, so reconnection
is not attempted.

And you would need to implement a custom PollingConsumerPollStrategy,
where you in the rollback throw the caused exception.
Otherwise the bridge error handler cannot react.

We may consider allowing to make this out of the box if you have
bridgeErrorHandler enabled, as then the caused exception will routed
in Camel and allow onException to trigger.


> Cheers
> Hilde
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/FTP-Consumer-Handle-UnknowHostException-tp5719362p5719523.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: FTP-Consumer: Handle UnknowHostException

Posted by Hilde <hi...@yahoo.de>.
Hello Claus!

Sorry for answering late.

Yes, I have enabled the option /throwExceptionOnConnectFailed=true/
Is that ok?

Cheers
Hilde



--
View this message in context: http://camel.465427.n5.nabble.com/FTP-Consumer-Handle-UnknowHostException-tp5719362p5719523.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: FTP-Consumer: Handle UnknowHostException

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Sep 14, 2012 at 4:51 PM, Hilde <hi...@yahoo.de> wrote:
> Hello Claus!
>
> For your approaches I was very glad. The option
> /consumer.bridgeErrorHandler=true/ was exactly what I was looking for.
> However the onException(Exception.class) inside the ftp consumer route is
> not reached! I don't know why.
>

Have you enabled the throwExceptionOnConnectFailed=true option on the
ftp endpoint.


> When I would follow your poll strategy approach I would have to do the
> validation to the ftp server for my own inside the begin() method of
> PollingConsumerPollStrategy. The validation there would be not exactly the
> same as it was original initiated via camel ftp.
> Therefore the test doesn't reflect the reality.
>
> Cheers
> Hilde
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/FTP-Consumer-Handle-UnknowHostException-tp5719362p5719375.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: FTP-Consumer: Handle UnknowHostException

Posted by Hilde <hi...@yahoo.de>.
Hello Claus!

For your approaches I was very glad. The option
/consumer.bridgeErrorHandler=true/ was exactly what I was looking for. 
However the onException(Exception.class) inside the ftp consumer route is
not reached! I don't know why. 

When I would follow your poll strategy approach I would have to do the
validation to the ftp server for my own inside the begin() method of 
PollingConsumerPollStrategy. The validation there would be not exactly the
same as it was original initiated via camel ftp. 
Therefore the test doesn't reflect the reality.

Cheers
Hilde



--
View this message in context: http://camel.465427.n5.nabble.com/FTP-Consumer-Handle-UnknowHostException-tp5719362p5719375.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: FTP-Consumer: Handle UnknowHostException

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Use a custom poll strategy or enable the bridge error handler option.


On Fri, Sep 14, 2012 at 1:50 PM, Hilde <hi...@yahoo.de> wrote:
> Hello everybody!
>
> We have created a ftp consumer route dynamically as follow:
>
>
>
> The thing is the configured endpoint cannot handle the situation if the ftp
> host is not connectable. The route cannot stop
> because the onException section is not reached. The log file instead has
> produced the following stack trace:
>
>
>
> Can someone please explain me how the ftp consumer route can stopped if a
> UnknowHostException was thrown? Actually I was
> convinced the endpoint options /maximumReconnectAttempts/ and
> /throwExceptionOnConnectFailed/ would be in charge for that.
>
> We are using Apache Camel 2.10.0
>
> Cheers
> Hilde
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/FTP-Consumer-Handle-UnknowHostException-tp5719362.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen