Details
Description
I created the following ticket yesterday:
https://issues.apache.org/jira/browse/CAMEL-18914
This issue was not a bug as it was a problem with the namespace.
I am creating a new ticket as the route template still doesn't load in 3.20.0 (In 3.19.0 it loads successfully).
Here is the code I am using:
// 1. Start Camel context = new DefaultCamelContext(); context.start(); //2. Load route template context.addRoutes((RouteBuilder) new MyTemplate()); //3. Create resource from string String content = "<templatedRoutes id=\"camel\" xmlns=\"http://camel.apache.org/schema/spring\">\n" + " <!-- create two routes from the template -->\n" + " <templatedRoute routeTemplateRef=\"myTemplate\">\n" + " <parameter name=\"name\" value=\"Manually Loaded Tempate\"/>\n" + " <parameter name=\"greeting\" value=\"Hello\"/>\n" + " </templatedRoute>\n" + "</templatedRoutes>"; Resource resource = ResourceHelper.fromString("in-memory.xml", content); //4. Load resource ExtendedCamelContext extendedCamelContext = context.adapt(ExtendedCamelContext.class); RoutesLoader loader = extendedCamelContext.getRoutesLoader(); loader.loadRoutes(resource); //5. check the size of all routes LOG.info("RoutesSize = " + context.getRoutesSize());
I added an example to reproduce this issue. When Camel version 3.19.0 is used the example works. When version 3.20.0 is used it fails. The example is configured with 3.19.0 (as the bom version).