Apache Camel addRoute Method take a lots of time to add the route

Viewed 27

I am building an apache camel application. I am pushing the routes through api like so

RouteBuilder routeBuilder = new RouteBuilder () {
        @Override
        public void configure() throws Exception {
            from ("file-watch://" + path)
                    .id (id)
                    .process (new FileChangeStarterExecutionProcessor ())
                    .noDelayer ()
                    .onException (Exception.class).handled (true)
                    .log (LoggingLevel.WARN, "Unable to watch directory exception ${exception.message}");
        }
    };

    try {
        context.addRoutes (routeBuilder);
        startRoute(id);
    } catch (Exception e) {
        e.printStackTrace ();
        log.error ("Can't submit route with id {} exception occurred {}", id, e.getMessage ());
    }

But this addRoutes method takes a lot of time around 4 minutes then I call start route on SpringBootCamelContext startRoute(id).

Can anyone please help me on this ?

0 Answers
Related