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 DFF84D15E for ; Sat, 20 Oct 2012 10:02:36 +0000 (UTC) Received: (qmail 82663 invoked by uid 500); 20 Oct 2012 10:02:36 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 82350 invoked by uid 500); 20 Oct 2012 10:02:36 -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 82324 invoked by uid 99); 20 Oct 2012 10:02:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Oct 2012 10:02:35 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.217.173 as permitted sender) Received: from [209.85.217.173] (HELO mail-lb0-f173.google.com) (209.85.217.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Oct 2012 10:02:31 +0000 Received: by mail-lb0-f173.google.com with SMTP id gj3so1019044lbb.32 for ; Sat, 20 Oct 2012 03:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=slGDRU43qvGwAv0yC15yE9jRui0du2/190en4Ue86Yg=; b=Y+L3IqWqVGxbOgKrm2wZFteGPU13xR8ajJ+5JZX6cQJTQ4O8uoAm2ci13hTCXjFZkQ C9zbcWdQouTCerhNlORUq3HAYbcXL1p12mzL1nPCPtA2ZxRVy1bj1Abi20lPzcBqgbMu F96YOhRYZ0rgP58eqaAsekAtjzdTSaEHsisi/Dqktlq8Ycj0FLNlB1ByypAkIkK9Ioa0 lyOj6EVvalmXE0Fcf//HSRyQOoRZ44BHm0+5wr5SPrNxaOpYwUkXYoul8xyUJam0ApWE l2t4WJwZOK7ilSPpwQS49yBC55iG7CPMZBsDseplNxNaeGyA9T4SZ4mGFZ3SWad2Wt6a RYBw== Received: by 10.112.36.65 with SMTP id o1mr1534394lbj.11.1350727329710; Sat, 20 Oct 2012 03:02:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.42.9 with HTTP; Sat, 20 Oct 2012 03:01:49 -0700 (PDT) In-Reply-To: <1350656700772-5721307.post@n5.nabble.com> References: <1350656700772-5721307.post@n5.nabble.com> From: Claus Ibsen Date: Sat, 20 Oct 2012 12:01:49 +0200 Message-ID: Subject: Re: Bug with completionSize on AggregatorProcessor To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi Yeah it looks like a bug. I logged a ticket https://issues.apache.org/jira/browse/CAMEL-5720 On Fri, Oct 19, 2012 at 4:25 PM, breilhes wrote: > Hi, > > > I have a problem when I used completionSize in an aggregator. > > For example, my route is : > > > strategyRef="aggregateBySatelliteStrategy" > > aggregationRepositoryRef="satelliteAggregationRepository" > completionTimeout="60000" > completionSize="50"> > > ${header[Identifier]} > > > header.DpcTCPCompletionSize > > > > > > > If in the exchange header, I have the value 1000 for key > DpcTCPCompletionSize, the aggregator still use the constant value 50 as > completionSize. > > Is is due to a bug in the method isCompleted(String key, Exchange exchange) > of AggregateProcessor. If completionSizeExpression is defined, not null and > with a value > 0. If the size of aggregation is less than > completionSizeExpression , it allready tests the end of aggregation with > completionSize. > > Here is the code : > > if (getCompletionSizeExpression() != null) { > Integer value = getCompletionSizeExpression().evaluate(exchange, > Integer.class); > if (value != null && value > 0) { > int size = exchange.getProperty(Exchange.AGGREGATED_SIZE, 1, > Integer.class); > if (size >= value) { > return "size"; > } > } > } > if (getCompletionSize() > 0) { > int size = exchange.getProperty(Exchange.AGGREGATED_SIZE, 1, > Integer.class); > if (size >= getCompletionSize()) { > return "size"; > } > } > > Regards > > > > -- > View this message in context: http://camel.465427.n5.nabble.com/Bug-with-completionSize-on-AggregatorProcessor-tp5721307.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cibsen@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen