Claus Ibsen created CAMEL-26939:
-----------------------------------

             Summary: camel-jbang - camel dev: reload faster and let camel cmd 
reload wait for the outcome
                 Key: CAMEL-26939
                 URL: https://issues.apache.org/jira/browse/CAMEL-26939
             Project: Camel
          Issue Type: Sub-task
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Measured on 2026-11-13 with the unpacked 4.24.0-SNAPSHOT camel-launcher on 
macOS (Apple M4 Pro, JDK 25), warm CDS archives, medians of 5-9 runs on a 
machine with other load (treat as +/-30 %). Estimates are marked as such. Paths 
are relative to {{dsl/camel-jbang/}}.

h3. Reload latency

10 edits at random times: median *1.10 s* (0.46-2.15 s) with the default; *0.55 
s* (0.24-0.70 s) with {{camel.main.routesReloadInterval=500}}. The reload 
itself takes about 10 ms. The cause is 
{{FileWatcherResourceReloadStrategy.pollTimeout=2000}} (line 72) plus 
{{stableTimeout=200}}. The AI launcher already uses 500 ms 
({{IntegrationLauncher.DEV_RELOAD_INTERVAL}}, line 64). Use 500 ms as the 
default of {{camel run --dev}} / {{camel dev}}.

h3. A reload an agent can wait for

{{camel cmd reload}} (0.46 s) goes through {{DefaultContextReloadStrategy}}: it 
reloads the whole context and returns no outcome, and 
{{FileWatcherResourceReloadStrategy.onReload}} is a no-op (line 157). Only the 
MCP and TUI tools have a {{ReloadOutcome}}; a CLI agent has to poll the log 
after an edit. Proposal: {{camel cmd reload --wait --json}} that reloads the 
changed files and returns the outcome (routes reloaded, errors), as the MCP 
tools do.

See also the reload findings in the run/dev ticket of this date (auto-detected 
application.properties never reloaded, only the first folder watched, constant 
reloads when the log is written into the project folder).

_Claude Code on behalf of Claus Ibsen_



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

Reply via email to