Hi, This capability is already available in the FTP component. You do not need to do pollEnrich etc.
Please check out the sample available in the link http://camel.apache.org/ftp.html http://camel.apache.org/ftp.html The sample is given below. Cheers, Ashwin... ---------------------------------------------------------------------------------- protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { public void configure() throws Exception { // we use a delay of 60 minutes (eg. once pr. hour we poll the FTP server long delay = 60 * 60 * 1000L; // from the given FTP server we poll (= download) all the files // from the public/reports folder as BINARY types and store this as files // in a local directory. Camel will use the filenames from the FTPServer // notice that the FTPConsumer properties must be prefixed with "consumer." in the URL // the delay parameter is from the FileConsumer component so we should use consumer.delay as // the URI parameter name. The FTP Component is an extension of the File Component. from("ftp://sc...@localhost/public/reports?password=tiger&binary=true&consumer.delay=" + delay). to("file://target/test-reports"); } }; } ---------------------------------------------------------------------------- leNerd wrote: > > Hi! > I want to start a route using a quartz component with a cron statement. > Then use pollEnrich to obtain messages from an FTP server and forward them > via a route. Something along these lines (Java DSL): > > from("quartz://scheduledpoll?cron=0/20+*+*+*+*+?") > .pollEnrich("ftp://" + props.getProperty("ftp.server") + > props.getProperty("ftp.inbox") > + "?username=" + props.getProperty("ftp.user") > + "&password=" + > props.getProperty("ftp.password") > + "&move=done") > .to("direct:someChannel"); > > > The problem is then, that as the quartz endpoint issues its one message > per firing, the pollEnrich component only retrieves one (that is 1) file > from the FTP server, as opposed to the intended batch of all available > files! > > The above is only an attempt to check a FTP server once in a while and > then retrieve all available files. I'm open to other solutions - also > using Spring XML DSL. > > > Reg. leNerd > > > ----- --- Ashwin Karpe, Sr. Principal Consultant, PS - Opensource Center of Competence Progress Software Corporation 14 Oak Park Drive Bedford, MA 01730 --- +1-972-304-9084 (Office) +1-972-971-1700 (Mobile) ---- Blog: http://opensourceknowledge.blogspot.com/ -- View this message in context: http://old.nabble.com/Scheduled-Polling-Consumer-on-FTP-endpoint-tp28678774p28680001.html Sent from the Camel - Users mailing list archive at Nabble.com.
