Hi 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 http://camel.apache.org/file2 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 <route> ... <filter> <simple>${file:size} < 2000000</simple> ... only process small files here </filter> </route> 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 <[email protected]> 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: > http://camel.465427.n5.nabble.com/File-Consumer-Max-File-Size-tp5451246p5451246.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
