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

   ## Backport of #25729
   
   Cherry-pick of #25729 onto `camel-4.22.x`.
   
   **Original PR:** #25729 - CAMEL-24486: camel-core - Simple language init 
block custom function lookup fails in dev profile
   **Original author:** @davsclaus
   **Target branch:** `camel-4.22.x`
   
   ### Original description
   
   - Fixes `DefaultSimpleFunctionRegistry.getFunction()` incorrectly failing to 
resolve Simple language custom functions defined via the init block (`$foo ~:= 
<expr>;`) whenever the `CamelContext` profile is `dev`.
   - In dev profile, the lookup intentionally bypasses its own function cache 
to support hot-reloading `SimpleFunction` beans registered in the Camel 
registry — but init-block custom functions are plain `Expression`s stored 
directly in that cache, not registry beans, so they were never found and route 
creation failed with `No custom simple function with name: X`.
   - Since `camel run` (camel-jbang) defaults to `--profile=dev`, this broke 
the init-block custom-function feature for essentially every JBang user, even 
though it worked fine outside dev profile (e.g. plain `mvn`/unit tests).
   - Reported by a community member via Zulip. Root-caused and reproduced 
independently of YAML/JBang in a plain unit test by setting 
`context.getCamelContextExtension().setProfile("dev")`.
   
   _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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to