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 65931D72A for ; Fri, 6 Jul 2012 13:00:25 +0000 (UTC) Received: (qmail 94930 invoked by uid 500); 6 Jul 2012 13:00:25 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 94644 invoked by uid 500); 6 Jul 2012 13:00:24 -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 94616 invoked by uid 99); 6 Jul 2012 13:00:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2012 13:00:24 +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 (nike.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; Fri, 06 Jul 2012 13:00:18 +0000 Received: by lbok6 with SMTP id k6so2234534lbo.32 for ; Fri, 06 Jul 2012 05:59:58 -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=anh08EcP6QqqFIa+737VoFSKosO5vs0/9fbaQLjLaXo=; b=Zd2T3rTaH+H4Ak/xJP0OAjcXPcDyRjm0HvH+2irpKmKT8DbYg7AJNZbmH56NE2u1k9 SVMcMw+9gga4OZsZxZVr8CdtK78w0XrDC1rGGh5zq8CLcnD5Ptlhw64s9uef1K+gJRaO h86HbBCBpvMC9Isg9Slaji1CuBLnl5KyPHiDtvExm6x3+KFYEOP7G7WRSKUoBUfFZp6p 7y9s0Fznqa/Peu4kk16cyWIX3KQLRxIZVDTK8VEWLt5RG9XaG8elcw7vwKMcFD2eFOAs wvMc82TQVdXTw3Sl36CQXXnQl9++dtEggYX/gYnZ5eWn1Nxumu7LCgXncuiApJPzzjP8 uKMw== Received: by 10.112.42.66 with SMTP id m2mr13687860lbl.46.1341579597820; Fri, 06 Jul 2012 05:59:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.49.73 with HTTP; Fri, 6 Jul 2012 05:59:37 -0700 (PDT) In-Reply-To: References: <1341569199865-5715604.post@n5.nabble.com> From: Claus Ibsen Date: Fri, 6 Jul 2012 14:59:37 +0200 Message-ID: Subject: Re: Filter and Aggregation Completion To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Fri, Jul 6, 2012 at 1:17 PM, Pontus Ullgren wrote: > Just figured out that in newer version of Camel you set the predicate > by calling > from("file:/camel/inbox?noop=true") > .aggregate().setCompletionPredicate(new Predicate() {...}) > > Seems like the aggregator page need some TLC . > No, please read the documentation. On the top of the page http://camel.apache.org/aggregator.html > // Pontus > > > On Fri, Jul 6, 2012 at 1:04 PM, Pontus Ullgren wrote: >> Just a quick guess. >> >> Since you are filtering out messages from the batch the aggregator >> will not reach a decision that the batch is completed. >> The completeion from batch will wait for ALL message to arrive. >> See section "Using Batch Consumer" on this page >> http://camel.apache.org/aggregator.html >> >> You should probably use some other means to verify that the batch is >> complete such as a custom PredicateAggregationCollection. >> >> >> // Pontus >> >> >> On Fri, Jul 6, 2012 at 12:06 PM, somnath wrote: >>> Hi, >>> >>> My requirement is >>> 1) Read a file location and extract only those files that have "End >>> Date=Today's Date" as one of the headers. >>> 2) Combine all of these files and generate a single file out of it. >>> >>> When I tried with >>> from("file:/camel/inbox?noop=true") >>> .filter().method("my-filter", "readyToProcess") // Has the >>> logic described in requirement (1) >>> .aggregate(simple(ANY_LITERAL),new >>> MyAggregator()).completionFromBatchConsumer() >>> .beanRef("my-processor", "process") >>> .to("file:/camel/outbox?flatten=true"); >>> >>> The program never enters the my-processor bean class and hence the files are >>> not generated at all. >>> >>> When removed the filter logic to the aggregate class it worked cleanly >>> from("file:/camel/inbox?noop=true") >>> .aggregate(simple(ANY_LITERAL),new >>> MyAggregator()).completionFromBatchConsumer() >>> .beanRef("my-processor", "process") >>> .to("file:/camel/outbox?flatten=true"); >>> >>> Is this an expected behaviour? >>> >>> -Somnath >>> >>> >>> -- >>> View this message in context: http://camel.465427.n5.nabble.com/Filter-and-Aggregation-Completion-tp5715604.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: cibsen@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen