Claus Ibsen created CAMEL-25616:
-----------------------------------

             Summary: camel-core - route reload regressions with templated 
routes: duplicated routes without routeId, and all routes removed when the 
route template is defined in Java
                 Key: CAMEL-25616
                 URL: https://issues.apache.org/jira/browse/CAMEL-25616
             Project: Camel
          Issue Type: Bug
          Components: camel-core
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Two regressions from CAMEL-25554 (PR #27745) and CAMEL-25598 (PR #27751), 
reported after the merge in the PR comments.

# With {{routesReloadRemoveAllRoutes=false}}, a {{templatedRoute}} without a 
{{routeId}} is added again on every reload 
({{RouteBuilder.updateTemplatedRoutesToCamelContext}}). The "same template 
replaces the existing route" rule only applies when the route has an id, so a 
route with a generated id is created next to the old one (duplicates, or 
"Multiple consumers for the same endpoint" with {{direct:}}). Before 
CAMEL-25554 such a route was left alone on reload.
# With {{routesReloadRemoveAllRoutes=true}} (default), when the route template 
is defined in Java ({{context.addRoutes(new RouteBuilder() ...)}}, no resource) 
and the {{templatedRoute}} is in a watched file, a reload of *any* watched file 
fails: {{RouteWatcherReloadStrategy}} now also reloads the file of the 
templated route, but {{removeRouteTemplates("*")}} removed the Java template 
and nothing adds it again ({{Cannot find RouteTemplate with id ...}}). The 
restore fails the same way, so the application runs without routes. Before 
CAMEL-25598 the other routes kept running.

Fix: skip templated routes without a routeId on the update path, and only 
reload the file of a templated route when its route template comes from a file.

Follow-ups (separate): keep Java-defined route templates across a reload, and 
reload a route template file used through {{kamelet:}} (not a regression).

_Claude Code on behalf of Claus Ibsen_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to