Hi

You can use org.apache.camel.support.PluginHelper

On Mon, Jul 31, 2023 at 11:04 PM Ricardo Garcia <thraw...@gmail.com> wrote:

> Hi, I am migrating to camel 4, as part of a broader migration to all
> jakarta API instead of javax API
> In camel 3 I could load routes from multiple external xml files:
>
> try (DirectoryStream<Path> ds = Files.newDirectoryStream(routesDir, "*.xml"
> );
> DefaultResourceResolvers.FileResolver resolver = new
> DefaultResourceResolvers.FileResolver()) {
> resolver.setCamelContext(camelContext);
> for(Path file : ds)
> try {
> log.debug("Loading routes in {}", file);
> Resource resource = resolver.resolve(file.toUri().toString());
> camelContext.getRoutesLoader().loadRoutes(resource);
> } catch(Exception ex) {
> log.error("Cannot load routes in " + file, ex);
> }
> }
> But in camel 4 RC2, "getRoutesLoader()" does not exist in
> DefaultCamelContext, nor in ExtendedCamelContext... so how should we do it
> then?
> Thanks
>
> --
> Chipu
>


-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to