I have a stand-alone Spring-Boot Java Application with many routes. One camel route uses the sftp component which is set up to retrieve and process files.
However, I do not want to periodically poll for new files, I would like to trigger or invoke the route on demand i.e via a human most probably. Button click or run a shell script for example.
I didn't see anything in the documentation about this. Is it possible?
Thanks
When you create a route, it already creates a consumer for your endpoint. What you need to do is, instead of defining a route, use the ConsumerTemplate to invoke the endpoint programmatically and receive the response.
If you are using Spring Boot, you could simply autowire the CamelContext in to your bean.
https://camel.apache.org/manual/consumertemplate.html
Here are some test cases from the Apache Camel source,
https://github.com/apache/camel/blob/main/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/integration/SftpConsumeTemplateIT.java