camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas A." <andreasasm...@gmail.com>
Subject Re: How do YOU handle scheduling?
Date Tue, 14 Sep 2010 12:30:42 GMT

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.

Mime
View raw message