Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 08BA810405 for ; Wed, 18 Sep 2013 20:25:12 +0000 (UTC) Received: (qmail 4671 invoked by uid 500); 18 Sep 2013 20:25:11 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 4619 invoked by uid 500); 18 Sep 2013 20:25:09 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 4605 invoked by uid 99); 18 Sep 2013 20:25:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Sep 2013 20:25:07 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of moxford@gmail.com designates 209.85.215.48 as permitted sender) Received: from [209.85.215.48] (HELO mail-la0-f48.google.com) (209.85.215.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Sep 2013 20:25:03 +0000 Received: by mail-la0-f48.google.com with SMTP id er20so6009839lab.7 for ; Wed, 18 Sep 2013 13:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=QIbjkI/b8OF8CBDk0+QYm9ibk5phiNC2TeM41Mu8ggM=; b=QvDDl1a8VqESboZMhcQfYpZn7UlZU2URRaoBvGdR3Yd9UZ7HWAlAT2wonxkCX1apab +Odz7Wa3jSnkc6IUvyQAY10SAtLrYFmeLzCGFtcWeX9lTeUxd+QpKCegNfVp1xysVtWl yh7o2VSwHlY2rkg4FnMZ41MRIf1WtMUEHVSAwDuDljlu1LkVzRXve3pAQ0x2ygDd4MAU KhRM4hv2CjUpNnz/2fIol/D/YZ7jO7A83n0myIb2VvS76UVNSd4hYvaCuThiZeSw79SU s+drM5s5E3XGt7iKuiP2HZzu4i1ezLPu6dYsZ1wjk+eB29hQzgSRCzE3xEftbeFU4PiG RrPQ== MIME-Version: 1.0 X-Received: by 10.112.167.230 with SMTP id zr6mr3165824lbb.35.1379535882131; Wed, 18 Sep 2013 13:24:42 -0700 (PDT) Received: by 10.114.180.9 with HTTP; Wed, 18 Sep 2013 13:24:42 -0700 (PDT) In-Reply-To: References: <1378313595903-5738697.post@n5.nabble.com> Date: Wed, 18 Sep 2013 13:24:42 -0700 Message-ID: Subject: Re: Conceptual understanding of altering routes runtime From: Mike Oxford To: users@camel.apache.org Content-Type: multipart/alternative; boundary=001a11c342ec359dbe04e6ae3a61 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c342ec359dbe04e6ae3a61 Content-Type: text/plain; charset=UTF-8 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 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 > 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 > --001a11c342ec359dbe04e6ae3a61--