Apache Camel has a very nice support for various protocols like FTP and "file" and I would like to use it just to just load a single file and maybe convert it a bit.
I understood how to do this using a RouteBuilder and CamelContext.start() like in the examples but I don't want a background daemon in an endless loop nor do I need complex routing.
How can I do something like:
String body = new DefaultCamelContext().justRunOnce(
from("ftp://ftp.example.com/data/foo.txt")
.validate(body().regex("My Data.*"))
.getBody());
I did read some answers on how to stop a Route using "controlbus?action=stop" or "timer?repeat=1" or similar but those still start Camel as a new thread and then use some hack to stop it. I'm not looking for a complicated solution that somehow manages it but rather would like to know if Camel is capable to be used in a lean 10-liner, like in my example above.