Claus Ibsen created CAMEL-28098:
-----------------------------------

             Summary: camel-yaml-io - after a route configuration is updated, 
the YAML route dump writes the old onException of the configuration as a 
top-level onException
                 Key: CAMEL-28098
                 URL: https://issues.apache.org/jira/browse/CAMEL-28098
             Project: Camel
          Issue Type: Bug
          Components: camel-yaml-dsl
            Reporter: Claus Ibsen
             Fix For: 4.25.0


h3. Problem
{{LwModelToYAMLDumper}} ({{core/camel-yaml-io}}) pulls the context-scoped 
definitions out of the routes again (CAMEL-25490, CAMEL-25494, CAMEL-25651). A 
definition whose identity is in a current route configuration is written with 
that configuration; the others are written as top-level entries. 
{{DefaultDumpRoutesStrategy.isInRouteConfiguration}} uses the same identity 
check.

When a route configuration is updated (removed and added again, as a route 
reload does), the running routes still hold the old onException definition, 
which is no longer in any configuration. The dumper then writes it as a 
top-level onException. Loading that dump would apply it to every route of the 
file.

h3. Proposed fix
* CAMEL-25142 step 1 (refresh the routes that use a route configuration when it 
is updated) removes the cause: the routes then hold the definitions of the 
current configuration.
* Independent of that, the dumpers could decide by the route configuration a 
definition came from (the applied route configuration ids of the route, or the 
{{routeConfiguration}} back-pointer of the definition), instead of by identity.

Test: update a route configuration, then dump the route as YAML: no top-level 
onException.

Found while analysing CAMEL-25142 (late binding of cross-cutting features), 
with probe tests on main (4a354d948e9c).

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to