You can limit the number of files to pickup in the poll, http://camel.apache.org/file2
See the maxMessagesPerPoll option On Fri, Feb 21, 2014 at 9:13 AM, skasish <[email protected]> wrote: > out of heap space if remote FTP site has too many files to pick up. > > Is there configuration problem. > > My simple code is given below > > import org.slf4j.*; > import org.apache.camel.*; > import org.apache.camel.builder.*; > import org.apache.camel.main.Main; > import org.apache.camel.component.dataset.*; > > public class FileDemoCamel extends Main { > static Logger LOG = LoggerFactory.getLogger(FileDemoCamel.class); > public static void main(String[] args) throws Exception { > FileDemoCamel main = new FileDemoCamel(); > main.enableHangupSupport(); > main.addRouteBuilder(createRouteBuilder()); > main.bind("sampleGenerator", createDataSet()); > main.run(args); > } > static RouteBuilder createRouteBuilder() { > return new RouteBuilder() { > public void configure() { > > from("ftp://admin@localhost:2121/MF?noop=true&password=admin&passiveMode=true&maxMessagesPerPoll=10000&doneFileName=${file:name.noext}.TRG") > .to("file://D:/temp"); > } > }; > } > static DataSet createDataSet() { > return new SimpleDataSet(); > } > } > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/out-of-heap-space-if-remote-FTP-site-has-too-many-files-to-pick-up-tp5747716.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen Make your Camel applications look hawt, try: http://hawt.io
