Read the java doc and documentation for the ConsumerTemplate. Or check chapter 3 or appendix C in the Camel book.
On Tue, Sep 14, 2010 at 2:30 PM, Andreas A. <[email protected]> wrote: > > Hi > > I'm now trying to just use a Spring trigger and a simple class using > ConsumerTemplate and ProducerTemplate to fetch the files. However, I can't > get the ConsumerTemplate to stop polling when I first start it, what's going > on? > > public class FtpsPoller { > �...@autowired > private ConsumerTemplate consumer; > > �...@autowired > private ProducerTemplate producer; > > public void poll() throws Exception { > String ftpsUri = > "ftps:{{ftp.address}}{{ftp.path.out}}?username={{ftp.username}}&password={{ftp.password}} > String fileUri = "file:{{path.out}}"; > Exchange exchange = null; > do { > exchange = consumer.receive(ftpsUri); > producer.send(fileUri, exchange); > } while(exchange != null); > consumer.stop(); //Doesn't stop anything > } > } > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-do-YOU-handle-scheduling-tp2838886p2839061.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
