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 9DB5817981 for ; Sat, 16 May 2015 05:14:45 +0000 (UTC) Received: (qmail 50027 invoked by uid 500); 16 May 2015 05:14:45 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 49982 invoked by uid 500); 16 May 2015 05:14:45 -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 49970 invoked by uid 99); 16 May 2015 05:14:44 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 May 2015 05:14:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 865731A2D67 for ; Sat, 16 May 2015 05:14:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id kf61N5KnAY42 for ; Sat, 16 May 2015 05:14:34 +0000 (UTC) Received: from mail-ig0-f175.google.com (mail-ig0-f175.google.com [209.85.213.175]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id D6B7A42B0E for ; Sat, 16 May 2015 05:14:33 +0000 (UTC) Received: by igcau1 with SMTP id au1so13682126igc.1 for ; Fri, 15 May 2015 22:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type; bh=AiKICkD8jg0+PSyqqFxhZ4f3gfbm5h967Xm26v4bSEU=; b=TsK9qwSakXrFHjQZdig+KmQnj1URgdC1XA5Ly4VU5zdRyjdgiEk7hEWtachfRV4QJu +OTAWsa1nUER06qkiQb7VtnAByi6vFdIZipN1TBANySrIbTsxyWpRRSZjNBGSiFCUWd6 ATeHjwpL3nrJRpufDJ3m03SOzQlfB5DbqsQw5MccR+mI2oWm3SDhxQXPek/T3gAmH14D 932UusdyD9+DgcQVsazg/q19RuogK2b0bIuCKb5N+/sqbeKjf7CmWtxK7/XY4dX4Nkic pf4d1+NrnBTr9laNQ2K6cUhV+PBbKLcn/lMZbv00SzUrC1zFc++OCT+dTXAwzdB4o1Us yRvA== X-Received: by 10.42.87.6 with SMTP id w6mr8465432icl.18.1431753273499; Fri, 15 May 2015 22:14:33 -0700 (PDT) Received: from Andrews-MacBook-Pro.local (205-178-77-85.c3-0.nwb-ubr1.chi-nwb.il.cable.rcn.com. [205.178.77.85]) by mx.google.com with ESMTPSA id fm3sm1086934igb.1.2015.05.15.22.14.32 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 May 2015 22:14:32 -0700 (PDT) Date: Sat, 16 May 2015 00:14:31 -0500 From: Andrew Block To: users@camel.apache.org, =?utf-8?Q?Davis=2C_Daniel?= Message-ID: In-Reply-To: References: Subject: Re: Implementing a counter in XML DSL and Simple X-Mailer: Airmail (249) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="5556d238_43f18422_13e" --5556d238_43f18422_13e Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Dan, Each exchange executing within the split is independent of each other. In= crementing the value of a header on one split exchange will have no effec= t on another.=C2=A0 If you want to get the number of split items, it is available after the s= plit in Exchange.CamelSplitSize header.=C2=A0 In addition, take a look at the other headers available within the splitt= er component =5B1=5D documentation for more options available - Andy =5B1=5D -=C2=A0http://camel.apache.org/splitter.html --=C2=A0 Andrew Block On May 15, 2015 at 11:50:51 AM, Davis, Daniel (davisda=40si.edu) wrote: =46rom Claus' 2011 blog I tried to implement a counter but I cannot get i= t to work inside a splitter (I need a count of only a subset of items). The example code is: =24=7Bheader.myCounter=7D++ By itself this code fails because myCounter is not a number. So I initialized it outside the Split but inside the same route. 0 No exceptions but it increments once and only once inside the split. So I simplified and removed the initialization. =24=7Bheader.ImageIndex=7D++= No exceptions but it also increments once and only once inside the split. It seems like it is grabbing the original header value off the exchange each time and incrementing it. Does anyone see what I am missing=3F Is split behavior in some way causing this=3F -- Dan Davis --5556d238_43f18422_13e--