camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Conceptual understanding of altering routes runtime
Date Thu, 05 Sep 2013 08:26:59 GMT

Also you dont have to use Camel routes.
Sometimes just use Camel as a client API and use ProducerTemplate /
ConsumerTemplate to use the Camel components can be fine.

On Wed, Sep 4, 2013 at 6:53 PM, lassesvestergaard
<> wrote:
> Hi all.
> This is a spinoff of a previous post:
> I decided to start a new thread, because I think this question is of a more
> general character.
> First of all, I ran into a problem regarding how to update a camel route
> runtime. My concrete problem is that I can't figure out how to update a sql
> query runtime. If I, for instance, want to have a query that fetches the
> first 3000 records of a table, on the first cycle of the camel route (let's
> say I use a timer to "fire" the route). In the next cycle, I want to fetch
> from record 3001 to 6000. I simply can't get my head around this problem,
> which is extremely simple in regular java. My conclusion from this is, that
> I have some fundamental misconceptions of what Apache camel is, and therefor
> I want to use this thread to discuss runtime altering of routes.
> For starters: As I understand, an Exchange is a entity that only exists
> within a single cycle of a route. This means that I can't use the Exchange
> object to save variables that I can use in the next cycle of the route. This
> further means that I can't use Exchange to alter configurations of a
> component - ex. I can't use it for giving the timer component a different
> period and I can't use it for altering variables in a sql query.
> Besides this, it seems that you can only write your route once, and the
> first time it's run, all component configurations are set - they cannot be
> altered from within the route it self. In my specific case, I have tried to
> put java variables into my sql query (having them assigned as class scoped
> attributes). In my route I have a Processor (see referenced thread at the
> top), and in that I have altered the java attributes. This seems to work
> fine, but the sql query doesn't get updated with the new value of my java
> variable.
> Furthermore, I haven't been able to find any good examples, that show how to
> alter the route configurations runtime (actually the configurations of each
> component in a route).
> Since I can't Google the problem away, I conclude that I have issues on the
> conceptual understanding of Camel. So, could someone please clarify how to
> understand runtime alterings of routes, and it would be even better if you
> have some concrete coding examples.
> I have chosen to use the java DSL approach instead of Spring.
> Best regards
> Lasse Vestergaard
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:

View raw message