Claus Ibsen created CAMEL-25858:
-----------------------------------
Summary: camel-main - dev mode: a reload that changes options of a
component sets only the last one, and drops the options that did not change
Key: CAMEL-25858
URL: https://issues.apache.org/jira/browse/CAMEL-25858
Project: Camel
Issue Type: Bug
Components: camel-main
Reporter: Claus Ibsen
Fix For: 4.24.0
In dev mode ({{camel run --dev}}, or {{camel.main.routesReloadEnabled}}), a
properties file that changed configures its components again
({{MainPropertiesReload}}, since CAMEL-19071). Each component of the reload is
created anew. Two things go wrong:
* *Several options of one component in one save: only the last one is set.*
{{BaseMainSupport.doAutoConfigurationFromProperties}} removes and creates the
component for each key ({{MainHelper.computeProperties}} calls the supplier
once per key, and with {{reload}} the supplier calls
{{camelContext.removeComponent(name)}}). Each option is set on another
instance, and only the last instance stays in the CamelContext.
* *An option that did not change is lost.* The reload passes only the
properties that changed (the file watcher keeps only those). The component is
created anew, with its defaults, and gets only those options, so the options
from the start of the application are gone.
Both are reproduced with {{MainPropertiesReload.onChanged}} and the log
component: two options in one reload set only the second; a reload that changes
{{lazy-start-producer}} drops {{source-location-logger-name}} from the start.
Found in a benchmark of Oct 19-20 2026: a model added
{{camel.component.langchain4j-chat.*}} options in one save, and the route
failed with "chatModel must be specified", although the reload logged all three
options. It stayed hidden before CAMEL-25767: with {{camel run
--source-dir=.}}, a reload did not apply component options at all.
Data formats and languages are not affected: a reload configures the existing
instance.
Proposal: create each component of a reload once, and configure it with all its
current options (from the properties component, ENV variables and JVM system
properties, as at startup), the options of the reload winning.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)