Hello

I'd like to integrate Apache Camel into an existing project and just
use some of it's endpoint capabilities (ftp, file, sftp etc.) to
fetch some files and maybe validate them a bit.

I don't want Camel to act as the main controller that dispatches
everything in the background.

Is it possible to use Camel in a very simplistic and lean way like e.g.:

    RouteBuilder simpleRoute = new RouteBuilder() {
        @Override
        public void configure() {
            
from("file://src/main/resources/inputs/?include=input.*\\.txt&noop=true")
                .convertBodyTo(String.class)
                .validate(body().regex("..."));
        }
    };

    String result = 
CamelContext.createSimpleConsumerTemplate(simpleRoute).receiveBody(String.class);

Currently it seems that I still have to add the route to the CamelContext,
start it, then call my ConsumerTemplate and after that stop the context.

Best Regards

-christian-

Reply via email to