You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by combsgd <co...@gmail.com> on 2011/07/01 16:54:00 UTC

CamelContext startRoute not starting with changes to RouteDefinition

There appears to be what I would think is a bug with calling the
CamelContext.startRoute(String routeId) for a route that already exists
within the context, but has had changes made to it.

Let me explain the scenario/situation in more detail ....

We have a route defined within our camel context, which is a polling
consumer to a FTP server which pulls down new images (e.g. JPEG) that are
delivered to us by clients. The directory structure on this server provides
the clients with a new daily directory for them to drop their daily images
in (as we preserve the previous days' images for 30 days). Our processing
preforms manipulation on those images and then pushes them onto another node
in the processing route.

A nightly tasks is associated with this which scrubs the servers local
directories of any image fragments or pieces of the images from the day's
processing. It also takes the existing single route, shuts it down and then
changes the input channel for for the next day's directory for the client.

Example....
At 12AM on 07/01/2011 the route's shut down and the input channel is changed
from "CLIENT_A_20110630" to "CLIENT_A_20110701", so that when the client
starts dropping images throughout the day, then the route will pick up the
images in that day's directory (and not still be looking at yesterday's
directory for the client).

What I'm seeing from a behavioral perspective for camel though is that once
the route definition's input channel has been changed, if I start the route
again using the route definition's ID (e.g.
myCamelContext.start("clientARoute") ), then the route starts again, but is
started with the old input channel that was for the previous day (e.g.
20110630). Though, if I call the start using the whole route definition
(e.g. myCamelContext.start(clientARouteDefinitionObject) ), then the route
will start again and correctly be polling the new/today's directory (e.g.
20110701).

When debugging these two behaviors individually I can see the CamelContext
object (e.g. myCamelContext) has the correct route definition, with the
correct inputs/from definitions (e.g. 20110701) in both cases before, and
after, the start is called of that route. Yet, it appears by calling the
start by the ID, and not the RouteDefinition object, it does not correctly
pick up the route changes. 

I have also verified that there is not a route within the CamelContext for
both definitions after I call the routeStart using the RouteDefinition
object (there is correctly only one route for that client, with the
correct/new path, in both cases).

--
View this message in context: http://camel.465427.n5.nabble.com/CamelContext-startRoute-not-starting-with-changes-to-RouteDefinition-tp4542395p4542395.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CamelContext startRoute not starting with changes to RouteDefinition

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

Can you post an example of an old route and a new route. eg I assume
the change is in the <from> uri ?



On Fri, Jul 1, 2011 at 4:54 PM, combsgd <co...@gmail.com> wrote:
> There appears to be what I would think is a bug with calling the
> CamelContext.startRoute(String routeId) for a route that already exists
> within the context, but has had changes made to it.
>
> Let me explain the scenario/situation in more detail ....
>
> We have a route defined within our camel context, which is a polling
> consumer to a FTP server which pulls down new images (e.g. JPEG) that are
> delivered to us by clients. The directory structure on this server provides
> the clients with a new daily directory for them to drop their daily images
> in (as we preserve the previous days' images for 30 days). Our processing
> preforms manipulation on those images and then pushes them onto another node
> in the processing route.
>
> A nightly tasks is associated with this which scrubs the servers local
> directories of any image fragments or pieces of the images from the day's
> processing. It also takes the existing single route, shuts it down and then
> changes the input channel for for the next day's directory for the client.
>
> Example....
> At 12AM on 07/01/2011 the route's shut down and the input channel is changed
> from "CLIENT_A_20110630" to "CLIENT_A_20110701", so that when the client
> starts dropping images throughout the day, then the route will pick up the
> images in that day's directory (and not still be looking at yesterday's
> directory for the client).
>
> What I'm seeing from a behavioral perspective for camel though is that once
> the route definition's input channel has been changed, if I start the route
> again using the route definition's ID (e.g.
> myCamelContext.start("clientARoute") ), then the route starts again, but is
> started with the old input channel that was for the previous day (e.g.
> 20110630). Though, if I call the start using the whole route definition
> (e.g. myCamelContext.start(clientARouteDefinitionObject) ), then the route
> will start again and correctly be polling the new/today's directory (e.g.
> 20110701).
>
> When debugging these two behaviors individually I can see the CamelContext
> object (e.g. myCamelContext) has the correct route definition, with the
> correct inputs/from definitions (e.g. 20110701) in both cases before, and
> after, the start is called of that route. Yet, it appears by calling the
> start by the ID, and not the RouteDefinition object, it does not correctly
> pick up the route changes.
>
> I have also verified that there is not a route within the CamelContext for
> both definitions after I call the routeStart using the RouteDefinition
> object (there is correctly only one route for that client, with the
> correct/new path, in both cases).
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CamelContext-startRoute-not-starting-with-changes-to-RouteDefinition-tp4542395p4542395.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.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/