camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Oxford <moxf...@gmail.com>
Subject Re: Conceptual understanding of altering routes runtime
Date Wed, 18 Sep 2013 20:24:42 GMT
I believe you can "synthesize" with a dynamic-router.

Get first chunk, route to processor-route.  When that route completes, it
will head back to dynamic-router with the same Exchange.  If that Exchange
has a property which says "this SQL connection" and a property which says
"this starting number" (or, if you have the handle to the SQL connection,
using a cursor) it may work for you.

G'luck...

-mox



On Thu, Sep 5, 2013 at 1:26 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:

> Hi
>
> 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
> <lassesvestergaard@gmail.com> wrote:
> > Hi all.
> >
> > This is a spinoff of a previous post:
> > http://camel.465427.n5.nabble.com/Change-timer-runtime-td5738484.html
> >
> > 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:
> http://camel.465427.n5.nabble.com/Conceptual-understanding-of-altering-routes-runtime-tp5738697.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message