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 70069D061 for ; Mon, 16 Jul 2012 07:06:31 +0000 (UTC) Received: (qmail 99795 invoked by uid 500); 16 Jul 2012 07:06:30 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 99687 invoked by uid 500); 16 Jul 2012 07:06:30 -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 99663 invoked by uid 99); 16 Jul 2012 07:06:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jul 2012 07:06: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.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; Mon, 16 Jul 2012 07:06:24 +0000 Received: by lbok6 with SMTP id k6so8684224lbo.32 for ; Mon, 16 Jul 2012 00:06:04 -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=ETic+RM0TxwyYoyCHCCO0GVwOpL0kQ1Pxy/UnUdIHP0=; b=vxGalb5Ffb0MUWo1IFrgKgN98F31bxa5stNC2TnYtdgIejKHHjUYNM7fMyuzXBUqRF KldN5eNf5fSap/CS1553duetYIGdLALHf378vP4TzgyzY8qEljNwK081py6o2pI9csv4 P7ZQDSzR+R5Pe4O7Jd6gLjo9HI/6ih+wIIJROANSawVbtg2B2DY9CPiaD75657eIqdx8 HPfS7ZkO4gtO9JDMnme3fuKURwOyIqP39KU++G0ETDQ1x/KVBCe0n20DqcokqdnhTCcy iv/JUk/qnQTsOh/EC1gnI/NyXWEnsODx5i6l9Vsg6bgXJyqjagPRmD/sHPNnR6RZDQMv gVew== Received: by 10.152.114.3 with SMTP id jc3mr10387166lab.11.1342422364271; Mon, 16 Jul 2012 00:06:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.49.73 with HTTP; Mon, 16 Jul 2012 00:05:44 -0700 (PDT) In-Reply-To: <1342420174860-5716064.post@n5.nabble.com> References: <1342420174860-5716064.post@n5.nabble.com> From: Claus Ibsen Date: Mon, 16 Jul 2012 09:05:44 +0200 Message-ID: Subject: Re: Preventing reading of a large XML file in memory To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Hi Use the localWorkDirectory option on the JMS endpoint to stream directly to a file when downloading the ftp file. Then the message body is a GenericFile type (also a org.apache.camel.WrappedFile from Camel 2.9 onwards) where you can access the file using a stream etc. So if you want to from ftp to bean (figure out file name) to file Then in the bean you need to set the header Exchange.FILE_NAME to whatever you want the file to be saved as. For that you can use the setHeader EIP and then use a method call expression (eg like a method call on a bean). On Mon, Jul 16, 2012 at 8:29 AM, vishal1981 wrote: > Hi, > I am using Camel to transfer a file from my app server to an FTP server > before converting it to a different format. The incoming file can be > potentially huge (60 to 100 gbs) in size and I want to prevent Camel from > reading the whole file in memory. I would like to call a bean which takes > the input file location and an output file location as a parameter and not > the message body. > Any pointers on how I can achieve this without reading the whole file in > memory? > Thanks in advance. > > -- > View this message in context: http://camel.465427.n5.nabble.com/Preventing-reading-of-a-large-XML-file-in-memory-tp5716064.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