you can achieve that by these steps:
1. create a bean or Camel component with Java interface component service, promote the service to a composite service
2. create and configure Scheduling and HTTP bindings on the composite service
3. create a component reference with Java interface (for example FtpService) on the component, promote it
4. create and configure FTP binding on the composite reference
5. In case that you have used a bean, add @Inject @Reference FtpService; to your bean or .to("switchyard:FtpService") in case of Camel. Invoke a particular method and assembly a response based on the downloaded file.
However, I don't know how to satisfy your requirement for changing of pooling interval at runtime.
If I understand correctly your problem, you want to fetch and FTP file with a REST request or with a sceduling policy?
If this is correct, then:
As services are not meant to be called by you, but they will call you, the FTP component when acting as a service is polling the FTP server, and it is why it doesn't serve your purpose. On the same way, a FTP reference can be used to put a file into an FTP server, as it will be a .to() like in a camel route, or the destination.
I think that the option you have is to create a SY Camel component, in where you add a Processor to fetch the file with a Scheduler service binding triggering the route, or the content enricher: http://camel.465427.n5.nabble.com/quartz-trigger-for-ftp-consumer-td473092.html
1 of 1 people found this helpful
Actually when reading carefully, the pollEnrich EIP can be used. I have created a sample project with file (instead of FTP): https://github.com/jorgemoralespou/fsw-documentation/tree/master/demos/switchyard/switchyard-pollenrich-example
Late, but I hope it helps anybody.