You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2026/09/09 08:16:27 UTC

[PR] CAMEL-24659: camel run defaults to the jbang runtime, and --runtime=main runs in a separate JVM [camel]

davsclaus opened a new pull request, #26226:
URL: https://github.com/apache/camel/pull/26226

   Fixes https://issues.apache.org/jira/browse/CAMEL-24659
   
   ## Motivation
   
   `camel run` runs the integration in-process inside the Camel CLI (jbang) JVM. That is great for prototyping, but the JVM classpath also contains camel-jbang-core and all its dependencies, so it does not look like a production deployment. `--runtime=spring-boot` and `--runtime=quarkus` already export to a temporary project and run via Maven in a clean JVM, and the TUI needs the same for Camel Main so what it observes matches what the user ships.
   
   ## Changes
   
   - **`camel run` defaults to a new `jbang` runtime**, which is the existing in-process behaviour. `RuntimeType` gains `jbang` and `exportRuntime()` (jbang exports as main). The shared `RuntimeTypeConverter` used by `camel export`, `camel dependency`, `camel version`, `camel update` and the kubernetes plugin treats `jbang` as an alias for `main`; `Run` uses its own converter and completion candidates.
   - **`--runtime=main` now runs in a separate JVM**: the sources are exported with `ExportCamelMain` to `.camel-jbang-run/<ts>`, packaged with the Maven wrapper, and the runner JAR is started with plain `java`. `camel:run` was not used because the camel-maven-plugin runs the main class inside the Maven JVM without forking. Supported: `--dev` (routes reload from the original source directory), `--source-dir`, `--jvm-args`, `--jvm-debug`, `--jfr`, `--profile`, `--camel-version` and the max duration options. In-process-only options (`--background`, `--code`, `--open-api`, `--empty`, `--mcp-stdio`) are rejected with a hint to use `--runtime=jbang`. An existing `pom.xml` still runs via `mvn camel:run`, and runtime detection from the pom only applies under `jbang`.
   - Logs go to `~/.camel/<name>.log` using the `camel.main.name` of the exported project, which `camel log` and the TUI Log tab already fall back to.
   - **TUI**: the F2 run options form always passes `--runtime=` (so Camel Main launches use the clean JVM) and offers JBang as a fourth choice when the runtime is not locked to a Maven project.
   - Docs: runtimes section in the running guide, 4.23 upgrade guide entry, TUI guide, regenerated command metadata.
   
   ## Testing
   
   - New `RuntimeTypeTest`; runtime option cases in `RunTest` and `ExportTest`; `DependencyListTest`, `DependencyUpdateTest` switch and TUI `RunOptionsFormTest` updated/passing.
   - Manually verified with the 4.23.0-SNAPSHOT CLI: `camel run --runtime=main hello.camel.yaml` starts a separate `java -jar` process visible in `camel ps`, writes the log file, `--dev` picks up a saved edit within seconds, `--max-seconds` stops the JVM, and the temp project and log are removed on exit.
   
   Follow-ups not in this PR: the Spring Boot and Quarkus runs ignore the max duration options in the same way, and the Quarkus run names its log after the export name rather than `camel.main.name`.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-24659: camel run defaults to the jbang runtime, and --runtime=main runs in a separate JVM [camel]

Posted by "lordrip (via GitHub)" <gi...@apache.org>.
lordrip commented on code in PR #26226:
URL: https://github.com/apache/camel/pull/26226#discussion_r3967080553


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -365,6 +367,8 @@ public boolean disarrangeLogging() {
             return true;
         } else if (RuntimeType.springBoot == runtime) {
             return true;
+        } else if (RuntimeType.main == runtime) {

Review Comment:
   [curious-question] Is this correct as-is? What do you think about using a `switch` or having those conditions as `||`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-24659: camel run defaults to the jbang runtime, and --runtime=main runs in a separate JVM [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26226:
URL: https://github.com/apache/camel/pull/26226#issuecomment-5598637915

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-24659: camel run defaults to the jbang runtime, and --runtime=main runs in a separate JVM [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #26226:
URL: https://github.com/apache/camel/pull/26226


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-24659: camel run defaults to the jbang runtime, and --runtime=main runs in a separate JVM [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26226:
URL: https://github.com/apache/camel/pull/26226#issuecomment-5602646129

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `docs`
   - `dsl/camel-jbang/camel-jbang-core`
   - `dsl/camel-jbang/camel-jbang-plugin-tui`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 8 tested, 8 compile-only — current: 6 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **16 affected modules** (current approach: 6).
   
   <details><summary>:warning: Modules only in Scalpel (10)</summary>
   
   - `camel-jbang-core`
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-launcher`
   - `coverage`
   - `docs`
   
   </details>
   
   **Skip-tests mode would test 8 modules** (3 direct + 5 downstream), **skip tests for 8** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (8)</summary>
   
   - `camel-jbang-core`
   - `camel-jbang-mcp`
   - `camel-jbang-plugin-mcp`
   - `camel-jbang-plugin-route-parser`
   - `camel-jbang-plugin-tui`
   - `camel-jbang-plugin-validate`
   - `camel-launcher-container`
   - `docs`
   
   </details>
   
   <details><summary>Modules with tests skipped (8)</summary>
   
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-launcher`
   - `coverage`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-core`: 1 test(s) disabled on GitHub Actions
   
   :bulb: **Manual integration tests recommended:**
   
   > You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
   > ```
   > mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
   > ```
   
   <details><summary>All tested modules (16 modules, 3m 29s total)</summary>
   
   **Total reactor time:** 3m 29s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 56.6s | SUCCESS |
   | Camel :: JBang :: MCP | 41.9s | SUCCESS |
   | Camel :: JBang :: Plugin :: TUI | 40.3s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 24.6s | SUCCESS |
   | Camel :: Docs | 21.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 11.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 2.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 2.3s | SUCCESS |
   | Camel :: Coverage | 1.9s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 1.4s | SUCCESS |
   | Camel :: JBang :: Plugin :: Route Parser | 1.4s | SUCCESS |
   | Camel :: JBang :: Main | 1.3s | SUCCESS |
   | Camel :: Launcher :: Container | 0.8s | SUCCESS |
   | Camel :: JBang :: Integration tests | 0.5s | SUCCESS |
   | Camel :: JBang :: Core | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (56.6s)
   - `Camel :: JBang :: MCP` (41.9s)
   - `Camel :: JBang :: Plugin :: TUI` (40.3s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (24.6s)
   - `Camel :: Docs` (21.0s)
   - `Camel :: JBang :: Plugin :: Testing` (11.0s)
   - `Camel :: JBang :: Plugin :: Validate` (2.6s)
   - `Camel :: JBang :: Plugin :: Edit` (2.3s)
   - `Camel :: Coverage` (1.9s)
   - `Camel :: JBang :: Plugin :: Generate` (1.8s)
   - `Camel :: JBang :: Plugin :: MCP` (1.4s)
   - `Camel :: JBang :: Plugin :: Route Parser` (1.4s)
   - `Camel :: JBang :: Main` (1.3s)
   - `Camel :: Launcher :: Container` (0.8s)
   - `Camel :: JBang :: Integration tests` (0.5s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/34340334635)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-24659: camel run defaults to the jbang runtime, and --runtime=main runs in a separate JVM [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #26226:
URL: https://github.com/apache/camel/pull/26226#discussion_r3967319228


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -365,6 +367,8 @@ public boolean disarrangeLogging() {
             return true;
         } else if (RuntimeType.springBoot == runtime) {
             return true;
+        } else if (RuntimeType.main == runtime) {

Review Comment:
   Good catch, thanks. It was correct but only by accident of history: the two existing branches were for Quarkus and Spring Boot, and this PR just appended a third for main. Since every runtime except the in-process jbang one now spawns a separate JVM, I collapsed it into a single `return RuntimeType.jbang != runtime;` with a comment, in 4b19869fb53e.
   
   _Claude Code on behalf of davsclaus_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org