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

[PR] CAMEL-24685: camel-joor - compile inline scripts once when preCompile=false [camel]

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

   `JoorExpression.evaluate` compiled into a local variable when `method` was null and never stored it, so with `preCompile=false` every exchange ran javac and defined a new class.
   
   `preCompile=false` with a `resource:` script is the documented hot re-load mode (`JoorPreCompileFalseTest` rewrites the file mid-test), so that path keeps recompiling. Inline scripts are now compiled once lazily into a volatile field. The joor and java language docs (and their catalog mirrors) say which is which. A new test sends two messages through a `preCompile=false` inline expression and asserts one compilation.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   _Claude Code on behalf of Croway_
   


-- 
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-24685: camel-joor - compile inline scripts once when preCompile=false [camel]

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

   :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-24685: camel-joor - compile inline scripts once when preCompile=false [camel]

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

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `catalog/camel-catalog`
   - `components/camel-joor`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 16 tested, 26 compile-only — current: 15 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **42 affected modules** (current approach: 15).
   
   <details><summary>:warning: Modules only in Scalpel (27)</summary>
   
   - `apache-camel`
   - `camel-allcomponents`
   - `camel-catalog`
   - `camel-catalog-console`
   - `camel-catalog-maven`
   - `camel-catalog-suggest`
   - `camel-componentdsl`
   - `camel-endpointdsl`
   - `camel-endpointdsl-support`
   - `camel-itest`
   - `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-kamelet-main`
   - `camel-launcher`
   - `camel-report-maven-plugin`
   - `camel-route-parser`
   - `camel-yaml-dsl`
   - `camel-yaml-dsl-deserializers`
   - `camel-yaml-dsl-maven-plugin`
   - `coverage`
   - `docs`
   - `dummy-component`
   
   </details>
   
   **Skip-tests mode would test 16 modules** (2 direct + 14 downstream), **skip tests for 26** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (16)</summary>
   
   - `camel-catalog`
   - `camel-java-joor-dsl`
   - `camel-jbang-mcp`
   - `camel-jbang-plugin-mcp`
   - `camel-jbang-plugin-route-parser`
   - `camel-jbang-plugin-tui`
   - `camel-jbang-plugin-validate`
   - `camel-joor`
   - `camel-kamelet`
   - `camel-launcher-container`
   - `camel-state-store`
   - `camel-test-main-junit5`
   - `camel-test-main-junit6`
   - `camel-xml-io-dsl`
   - `camel-yaml-dsl-validator`
   - `camel-yaml-dsl-validator-maven-plugin`
   
   </details>
   
   <details><summary>Modules with tests skipped (26)</summary>
   
   - `apache-camel`
   - `camel-allcomponents`
   - `camel-catalog-console`
   - `camel-catalog-maven`
   - `camel-catalog-suggest`
   - `camel-componentdsl`
   - `camel-endpointdsl`
   - `camel-endpointdsl-support`
   - `camel-itest`
   - `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-kamelet-main`
   - `camel-launcher`
   - `camel-report-maven-plugin`
   - `camel-route-parser`
   - `camel-yaml-dsl`
   - `camel-yaml-dsl-deserializers`
   - `camel-yaml-dsl-maven-plugin`
   - `coverage`
   - `docs`
   - `dummy-component`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   <details><summary>All tested modules (42 modules, 6m 41s total)</summary>
   
   **Total reactor time:** 6m 41s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: YAML DSL | 59.9s | SUCCESS |
   | Camel :: Launcher | 50.7s | SUCCESS |
   | Camel :: JBang :: MCP | 38.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: TUI | 30.2s | SUCCESS |
   | Camel :: jOOR | 22.7s | SUCCESS |
   | Camel :: Kamelet | 17.8s | SUCCESS |
   | Camel :: Component DSL | 17.5s | SUCCESS |
   | Camel :: Catalog :: Camel Catalog | 17.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 15.7s | SUCCESS |
   | Camel :: Docs | 14.0s | SUCCESS |
   | Camel :: Test :: Main :: JUnit5 | 13.0s | SUCCESS |
   | Camel :: Test :: Main :: JUnit6 | 13.0s | SUCCESS |
   | Camel :: Java DSL with jOOR | 9.5s | SUCCESS |
   | Camel :: Catalog :: Camel Report Maven Plugin | 8.8s | SUCCESS |
   | Camel :: Kamelet Main | 8.1s | SUCCESS |
   | Camel :: XML DSL with camel-xml-io | 8.0s | SUCCESS |
   | Camel :: Catalog :: Camel Route Parser | 7.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 7.7s | SUCCESS |
   | Camel :: YAML DSL :: Deserializers | 5.2s | SUCCESS |
   | Camel :: All Components Sync point | 4.8s | SUCCESS |
   | Camel :: YAML DSL :: Validator | 4.4s | SUCCESS |
   | Camel :: State Store | 3.3s | SUCCESS |
   | Camel :: Catalog :: Suggest (deprecated) | 3.2s | SUCCESS |
   | Camel :: YAML DSL :: Validator Maven Plugin | 3.2s | SUCCESS |
   | Camel :: Catalog :: Maven | 2.7s | SUCCESS |
   | Camel :: YAML DSL :: Maven Plugins | 2.7s | SUCCESS |
   | Camel :: Coverage | 1.6s | SUCCESS |
   | Camel :: Assembly | 1.6s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.2s | SUCCESS |
   | Camel :: JBang :: Main | 1.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.0s | SUCCESS |
   | Camel :: Catalog :: Dummy Component | 0.8s | SUCCESS |
   | Camel :: Endpoint DSL :: Support | 0.7s | SUCCESS |
   | Camel :: Launcher :: Container | 0.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 0.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 0.6s | SUCCESS |
   | Camel :: Catalog :: Console | 0.5s | SUCCESS |
   | Camel :: JBang :: Plugin :: Route Parser | 0.5s | SUCCESS |
   | Camel :: Endpoint DSL | n/a |  |
   | Camel :: Integration Tests | n/a |  |
   | Camel :: JBang :: Core | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: YAML DSL` (59.9s)
   - `Camel :: Launcher` (50.7s)
   - `Camel :: JBang :: MCP` (38.0s)
   - `Camel :: JBang :: Plugin :: TUI` (30.2s)
   - `Camel :: jOOR` (22.7s)
   - `Camel :: Kamelet` (17.8s)
   - `Camel :: Component DSL` (17.5s)
   - `Camel :: Catalog :: Camel Catalog` (17.2s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (15.7s)
   - `Camel :: Docs` (14.0s)
   - `Camel :: Test :: Main :: JUnit5` (13.0s)
   - `Camel :: Test :: Main :: JUnit6` (13.0s)
   - `Camel :: Java DSL with jOOR` (9.5s)
   - `Camel :: Catalog :: Camel Report Maven Plugin` (8.8s)
   - `Camel :: Kamelet Main` (8.1s)
   - `Camel :: XML DSL with camel-xml-io` (8.0s)
   - `Camel :: Catalog :: Camel Route Parser` (7.8s)
   - `Camel :: JBang :: Plugin :: Testing` (7.7s)
   - `Camel :: YAML DSL :: Deserializers` (5.2s)
   - `Camel :: All Components Sync point` (4.8s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/34580572810)


-- 
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-24685: camel-joor - compile inline scripts once when preCompile=false [camel]

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


##########
components/camel-joor/src/main/java/org/apache/camel/language/joor/JoorCompiler.java:
##########
@@ -81,6 +81,13 @@ public Map<String, String> getAliases() {
         return aliases;
     }
 
+    /**
+     * Number of scripts this compiler has compiled so far.
+     */
+    public int getCounter() {

Review Comment:
   Two small things about exposing this.
   
   `JoorPreCompileFalseInlineTest` lives in `org.apache.camel.language.joor`, the same package as `JoorCompiler`, so a package-private accessor gets the test what it needs without growing the public surface of a component class. CLAUDE.md is strict about public API and this is only needed for a test.
   
   Second, `counter` is a plain `int` incremented in `compile(...)` with no synchronisation. That was already true and only fed a debug log, so it did not matter; a public getter makes it look like a reliable number. Concurrent compiles of *different* expressions can lose an increment, so a caller could see a count lower than the number of compiles. Either make it an `AtomicInteger` or say in the javadoc that it is approximate and intended for diagnostics.
   
   (The test itself is fine as written — `MockEndpoint.assertIsSatisfied` gives the happens-before, and only one expression is compiling.)



-- 
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-24685: camel-joor - compile inline scripts once when preCompile=false [camel]

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


-- 
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