You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Guillaume Yziquel <gu...@crossing-tech.com> on 2011/12/15 14:45:23 UTC

Endpoint lifecycle and irrecoverable errors

Hi.

I've got a small question concerning best practice with respect to the
lifecycle of the endpoints of a Camel component: Should there be a way,
in case of irrecoverable errors, to shut down the endpoint on which
irrecoverable errors occurred?

-- 
Guillaume Yziquel
Software Developer

Crossing-Tech
Parc Scientifique EPFL

Re: Endpoint lifecycle and irrecoverable errors

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Dec 16, 2011 at 8:50 AM, Guillaume Yziquel
<gu...@crossing-tech.com> wrote:
> Le Friday 16 Dec 2011 à 09:50:31 (+0800), Willem Jiang a écrit :
>> You can shutdown the route in the error handler. I don't think
>> shutdown the endpoint is good practices, as it will cause some
>> trouble when the message is routed to that endpoint.
>
> Thanks. So shutting down the endpoint does not seem good practice.
>
> What about initialisation of the endpoint? Should we fail to create it
> if the underlying communication channel is unavailable?
>

Its component specific. There is no rule enforced by Camel.

Some components can self heal and recover (eg JMS with re-connect and
failover). Others cannot etc.
Some components allow end users to specify if they want to lazy
connect to remote system eg upon demand.
Others have options to check for valid connection upon start.

If an endpoint cannot work upon starting, then throw an exception from
the doStart method.
This will signal to Camel that starting a route that uses this
endpoint, does not work.

However if your endpoint can recover itself, then you may not want to
throw an exception in doStart, but re-connect / self heal from within
the endpoint.



> --
> Guillaume Yziquel
> Software Developer
>
> Crossing-Tech
> Parc Scientifique EPFL



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

Re: Endpoint lifecycle and irrecoverable errors

Posted by Guillaume Yziquel <gu...@crossing-tech.com>.
Le Friday 16 Dec 2011 à 09:50:31 (+0800), Willem Jiang a écrit :
> You can shutdown the route in the error handler. I don't think
> shutdown the endpoint is good practices, as it will cause some
> trouble when the message is routed to that endpoint.

Thanks. So shutting down the endpoint does not seem good practice.

What about initialisation of the endpoint? Should we fail to create it
if the underlying communication channel is unavailable?

-- 
Guillaume Yziquel
Software Developer

Crossing-Tech
Parc Scientifique EPFL

Re: Endpoint lifecycle and irrecoverable errors

Posted by Willem Jiang <wi...@gmail.com>.
You can shutdown the route in the error handler. 
I don't think shutdown the endpoint is good practices, as it will cause 
some trouble when the message is routed to that endpoint.
 
On Thu Dec 15 21:45:23 2011, Guillaume Yziquel wrote:
> Hi.
>
> I've got a small question concerning best practice with respect to the
> lifecycle of the endpoints of a Camel component: Should there be a way,
> in case of irrecoverable errors, to shut down the endpoint on which
> irrecoverable errors occurred?
>



-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang 
Weibo: willemjiang