[
https://issues.apache.org/jira/browse/CAMEL-18922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17677064#comment-17677064
]
Raymond edited comment on CAMEL-18922 at 1/15/23 4:49 PM:
----------------------------------------------------------
Just a question, when I use the snapshot version, can I then test it by using
it this way:
{code:java}
loader.loadRoutes(resource);{code}
was (Author: skin27):
Just a question, when I use the snapshot version, can I then test it by using
this way:
loader.loadRoutes(resource);
> TemplatedRoute fails to load with XML RouteLoader
> -------------------------------------------------
>
> Key: CAMEL-18922
> URL: https://issues.apache.org/jira/browse/CAMEL-18922
> Project: Camel
> Issue Type: Bug
> Components: came-core
> Affects Versions: 3.20.1
> Reporter: Raymond
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 3.20.2, 3.21.0, 4.0
>
> Attachments: routeloader-with-routetemplate.7z,
> routeloader-with-routetemplate.zip
>
>
> 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:
> {code:java}
> // 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()); {code}
> 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).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)