camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Preventing reading of a large XML file in memory
Date Mon, 16 Jul 2012 07:05:44 GMT
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
<vishal.changrani@ericsson.com> 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

Mime
View raw message