camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rosenbergj <>
Subject RE: File Consumer Max File Size
Date Thu, 02 Feb 2012 17:16:44 GMT
Thank you for the quick reply.  Your dedication to supporting Camel is much appreciated.


That helps prevent the file from being processed.  Is there any DSL magic I could do so that
I could be alerted that the file is there, but not process it within camel?


If I cannot do this in the same route, could I use another route that had the reverse filter,
but somehow not load the file and just delete/move it?




From: Claus Ibsen-2 [via Camel] [] 
Sent: Thursday, February 02, 2012 11:06 AM
To: Justin Rosenberg
Subject: Re: File Consumer Max File Size



You can use a filter option, and implement the interface, where you 
return true|false. 
Then you can check the file size if its > 200mb and return false. 

See the section _Filter using 
org.apache.camel.component.file.GenericFileFilter_ at

The file size is also provided in a CamelFileSize header, so you can 
also use the Filter EIP or Content Based Router EIP to route depending 
on the file size. 

Then you can use the simple language as a predicate 
    <simple>${file:size} < 2000000</simple> 
     ... only process small files here 

Notice the file size is in bytes, so insert a value that matches the 200mb 

On Thu, Feb 2, 2012 at 5:43 PM, rosenbergj <[hidden email]> wrote: 

> I've run into the a problem that if the File Consumer tries to process a 
> large file (excess of 200MB) I run out of Heap Space. 
> Is there a way to tell the file2 Endpoint to ignore files over a certain 
> size? 
> Does the File Endpoint serialize the data into the message or does it just 
> provide a pointer to the file?  If the latter, is there a way to 
> programatically inspect the size of the body of the message before loading 
> into a byte array? 
> I have the same questions for the ftp2 endpoint. 
> Thank you, 
> ~Justin 
> -- 
> View this message in context:
> Sent from the Camel - Users mailing list archive at 

Claus Ibsen 
Email: [hidden email] 
Twitter: davsclaus, fusenews 
Author of Camel in Action:


If you reply to this email, your message will be added to the discussion below: 

To start a new topic under Camel - Users, email 
To unsubscribe from Camel - Users, click here <>

The information in this message, and any attachment, is intended for the 
sole use of the individual and entity to whom it is addressed. This 
information may be privileged, confidential, and protected from 
disclosure. If you are not the intended recipient you are hereby notified 
that you have received this communication in error and that any review, 
disclosure, dissemination, distribution or copying of it, or its contents, 
is strictly prohibited. If you think that you have received this message 
in error please notify the sender and destroy all copies of this 
communication and any attachments. Thank you.

View this message in context:
Sent from the Camel - Users mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message