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 31BBBD370 for ; Thu, 7 Mar 2013 07:17:31 +0000 (UTC) Received: (qmail 7021 invoked by uid 500); 7 Mar 2013 07:17:29 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 6960 invoked by uid 500); 7 Mar 2013 07:17:29 -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 6950 invoked by uid 99); 7 Mar 2013 07:17:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Mar 2013 07:17:29 +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.210.177 as permitted sender) Received: from [209.85.210.177] (HELO mail-ia0-f177.google.com) (209.85.210.177) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Mar 2013 07:17:24 +0000 Received: by mail-ia0-f177.google.com with SMTP id y25so138501iay.36 for ; Wed, 06 Mar 2013 23:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=4M4BTa2gFb0Eq7+EoD9qbWN09wzzAQFvdbcovl3UPrk=; b=HsX3PePnJZf3JAdkZ4vSvzDpNPcPcJpbJ9nR1itJZUB/4onWgs3CE3CHw4AXHaG6Yg ZE7mcJzClL5juKVObUd/F6V+eo/mjW/I0NGevt0wj9e3HA5v09FOmBHaabnBHel8SwGA QZpvjRg93oYR0TJW2QD1sP4Rv9ZrS1jCDH1j9AP4IsnMIX7Q3esF69Z4mhB9c7Aieh1P 5p4riuluga2ZVMNmNdE5ELqba5h934aWRqwXoN1E076ioeWi/2teqOhBmwpWvO57VvWI XPLZ7z9bafKjvxfWLwt8Vzw4lgCuAStKmELhy/kkV7xZUCH55lGElAp752rnzHyCa6JR 3Fjg== X-Received: by 10.42.33.196 with SMTP id j4mr33289543icd.4.1362640623203; Wed, 06 Mar 2013 23:17:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.53.232 with HTTP; Wed, 6 Mar 2013 23:16:43 -0800 (PST) In-Reply-To: <1362582300279-5728689.post@n5.nabble.com> References: <1362578527188-5728680.post@n5.nabble.com> <1362581504605-5728686.post@n5.nabble.com> <1362582300279-5728689.post@n5.nabble.com> From: Claus Ibsen Date: Thu, 7 Mar 2013 08:16:43 +0100 Message-ID: Subject: Re: Aggregate exchanges until before EoF To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Mar 6, 2013 at 4:05 PM, cristisor wrote: > Yes, I already used aggregators to build batches of data that I will later > use for db operations and they work great. But I don't know how to implement > a custom splitter that, for example, sets the file complet flag only on the > last split line, is this possible? > Yeah its possible but you would need to write a custom code for that. You can wrap the existing from Camel and then read the data one-ahead. And then you would be able to know the the file is EOF when you are at the 2nd last line. I guess you want streaming mode, if you are not in streaming mode, then the splitter has a total size as well. Then you would know if you are at total - 1 currently. But in streaming mode the splitter does not know the total size, and has only current index and if its completed. PS: There is also a group option on the tokenizer. You may be able to enhance that existing code to make it discard X last lines. Not sure if this is a common use-case for others, to be able to group X lines and discard Y lines at the end. > > > -- > View this message in context: http://camel.465427.n5.nabble.com/Aggregate-exchanges-until-before-EoF-tp5728680p5728689.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