Reputation: 189
I am trying to get files from a remote ftp server by using camel-ftp component. I am using blueprint to develop my example.
If I implement that as in the examples in main page of component (http://camel.apache.org/ftp.html ), I have no problem with it.
My problem is that when I can only use this component as comsumer and it is always listening the remote directory.
(< from uri="sftp://test@remoteServer//var/opt/test?password=secret"/>).
The thing I want to do is that trigger this route with seda and after one run, it should get the files to local directory and then continue with next route like below (It isnot working ordinarily because of double from in a route).
<?xml version="1.0" encoding="UTF-8"?>
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<camelContext id="blueprintContext" trace="false"
xmlns="http://camel.apache.org/schema/blueprint">
<route id="source_quartz">
<from
uri="quartz://myGroup/myTimerName?trigger.repeatInterval=10000&trigger.repeatCount=0" />
<to uri="seda:step1" />
</route>
<route id="ftp_ruote">
<from uri="seda:step1" />
<from uri="sftp://test@remoteServer//var/opt/test?password=secret"/>
<to uri="file:///local/test" />
<to uri="seda:step2" />
</route>
.
.
.
</camelContext>
Upvotes: 0
Views: 1088
Reputation: 55710
Take a look at route policy, which allows you to associate a route with eg a quartz route policy, where you can configure start|stop intervals when a route should be active.
See the following links. Then you only need 1 route:
Upvotes: 1