Claus Ibsen created CAMEL-25631:
-----------------------------------
Summary: camel-core - Deprecate Route.clearRouteModel and remove
it in a later release
Key: CAMEL-25631
URL: https://issues.apache.org/jira/browse/CAMEL-25631
Project: Camel
Issue Type: Task
Components: camel-core
Reporter: Claus Ibsen
Fix For: 4.24.0
{{Route.clearRouteModel()}} drops the references a runtime route holds to its
model once the route is created: the route definition, the error handler
factory and the error handlers by factory. It came from the lightweight work:
* CAMEL-15795 (2020) added it, so the runtime route is not tied to the model
after the reifier has created it.
* CAMEL-15802 and CAMEL-15839 (2020) also cleared the error handler factory,
for the lightweight context.
* CAMEL-18421 (2022) limited it to the startup phase, so routes added after
startup keep their model.
* CAMEL-19292 (2023) removed the experimental {{LightweightCamelContext}}, its
main user.
The CamelContext keeps the route definitions in its model anyway (the
route-structure and route-topology dumps read them from there), so the clearing
saves little today. It also makes the runtime route differ by when it was
added: {{getRoute()}} and {{getErrorHandlerFactory()}} return null for a route
created at startup, but not for a route added later.
Proposal:
* Deprecate {{Route.clearRouteModel()}} in 4.24 and stop calling it from
{{RouteReifier}}.
* Update the javadoc of {{Route.getRoute()}}, which says it is null after the
route has been created.
* Note the deprecation in the 4.24 upgrade guide.
* Remove the method in a later release.
Found while working on CAMEL-25466.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)