Claus Ibsen created CAMEL-25619:
-----------------------------------
Summary: camel-core - route reload: keep route templates defined
in Java, and reload a route template file used through kamelet:
Key: CAMEL-25619
URL: https://issues.apache.org/jira/browse/CAMEL-25619
Project: Camel
Issue Type: Improvement
Components: camel-core
Reporter: Claus Ibsen
Fix For: 4.24.0
Follow-up of CAMEL-25616 (reported in the comments of PR #27751).
# A route template defined in Java ({{context.addRoutes(new RouteBuilder()
...)}}, no resource) is removed by {{RouteWatcherReloadStrategy}}
({{removeRouteTemplates("*")}}) and nothing adds it again. Since CAMEL-25616
the file with its {{templatedRoute}} is not loaded again either, so the
templated route is missing after a reload of another file. Keep the templates
without a resource (only remove the templates that are loaded again), and then
load the templated route file again.
# A route template in a watched file that is only used through {{kamelet:}} (no
{{templatedRoute}}) is not loaded again on a reload of another file
({{isCreatedByKamelet()}} skip), so the route calling {{kamelet:greeting}}
fails with {{Resource not found: classpath:kamelets/greeting.kamelet.yaml}} and
the restore fails too. Collect the source resource of a Kamelet route when it
is a file, and load it before the routes that use it.
Reproducers are in the PR #27751 comments.
_Claude Code on behalf of Claus Ibsen_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)