camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] Commented: (CAMEL-3001) Endpoints are recreated instead or restarted
Date Tue, 27 Jul 2010 16:06:51 GMT


Claus Ibsen commented on CAMEL-3001:

Thanks for being so cheerful.

Stopping a CamelContext means shutting it down. It's primary intent is to shutdown in a reliable
and graceful manner!

A CamelContext is *not* meant to be pause and resumed on-the-fly at your will.

You can do that on the consumers, if you want to pause activity in Camel.
And some consumer is specialized for that as they are {{SuspendableService}}

> Endpoints are recreated instead or restarted
> --------------------------------------------
>                 Key: CAMEL-3001
>                 URL:
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: William Tam
>             Fix For: 2.5.0
> The change (r979549) made by CAMEL-2991 causes every single endpoint to be recreated
instead of restarted which takes Camel a (quite big) step back.  It is bad for the following
> 1) recreating services associated could be expensive (the design should not assume recreating
the services is cheap).
> 2) states (if any) in Endpoint/Service could not be preserved (stop does not mean destroy
after all).   
> 3) it is unnecessary to recreate to the whole shebank and it is an unexpected behavior
for the users.  (Users think stop but it is gone.)
> In the code (DefaultCamelContext.doStartCamel()), one can clearly see the original intent
of the author (who even bothered to put in a nice comment) is to avoid re-initialization the
route definition after stopping the camel context.  (Well, things may change but not necessarily
for the better.)
> {code}
>        // To avoid initiating the routeDefinitions after stopping the camel context
>         if (!routeDefinitionInitiated) {
>             startRouteDefinitions(routeDefinitions);
>             routeDefinitionInitiated = true;
>         }
> {code}
> But, the change simply reset the routeDefinitionInitiated flag in doStop() which is the
exact opposite of the original intention and routeDefinitionInitiated is unless pretty much.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message