Claus Ibsen created CAMEL-27888:
-----------------------------------
Summary: camel-language: clearContentCache drops an inline script,
cacheScript precompile is skipped for external scripts
Key: CAMEL-27888
URL: https://issues.apache.org/jira/browse/CAMEL-27888
Project: Camel
Issue Type: Bug
Components: camel-language
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-language for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31155).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. clearContentCache drops an inline script
{{LanguageEndpoint.clearContentCache()}} (a JMX operation) sets script and
expression to null whatever the source of the script, so an endpoint with an
inline script or the script option then fails on every message with "No script
to evaluate"; with cacheScript the loaded content is lost too.
Proposed change: only reset when the content came from resourceUri.
h4. 2. cacheScript precompile is skipped for external scripts
doInit() skips pre-compiling a file: or http: script with cacheScript=true, but
createProducer() loads and compiles it anyway.
Proposed change: make the two consistent.
h4. 3. A #name script resolves differently
The producer turns #name into a ref:name resource (InputStream), while
resolveScript() (cacheScript and the header) does a mandatoryLookup of a String.
Proposed change: use one way.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)