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

   ## Description
   
   Two startup failures from the round-2 benchmark where the validator was 
clean and the runtime refused the file with a message the validator can give 
before the run. Both follow what `camel run` actually does.
   
   - **`resource:classpath:shipment-mapping.groovy` in an expression, with the 
file next to the route.** `camel run` sorts the directory's files by kind: 
files it does not know (an `.xsl`, a `.json`) go on the classpath through 
`ExtraFilesClassLoader`, so `resource:classpath:packing-slip.xsl` works; a 
`.groovy` (or `.java`, `.js`, `.kts`, `.jsh`, `.properties`, `.sh`) is a source 
it loads itself and does not put on the classpath, so the same syntax fails 
with "Cannot find resource". The existing resource check only looked at 
endpoint uris (`xslt:`, `language:`); it now also scans `resource:classpath:x` 
/ `resource:file:x` in expression values: a classpath reference to a source 
next to the route says `write resource:file:x`, a file that exists nowhere says 
so (with the name-only form when the file is there under another path), a 
classpath reference to a non-source file is left alone.
   - **`to: file://archived/${header.monthDir}?fileName=...`**: the directory 
of a file endpoint cannot be dynamic, and the runtime says so only at startup. 
The endpoint checks now report it on `to:` and `from:` with the form to write: 
keep the directory fixed and put the dynamic part in `fileName`, or use `toD:`, 
which evaluates the uri per message. `toD`, `wireTap`, `enrich` and 
`pollEnrich` evaluate the expression before the endpoint exists and are left 
alone.
   
   Noted on the Jira as an open CLI question, not done here: whether `camel 
run` should also put its known files on the classpath so `classpath:` works for 
them the way Spring Boot and Quarkus users expect.
   
   ## Tests
   
   - `SourceValidatorResourceRefsTest` (new, temp directory): classpath to a 
script next to the route, file to the same, classpath to a stylesheet, and a 
file that is not there with and without a same-named file elsewhere.
   - `SourceValidatorEndpointTest`: the dynamic directory on `to:` reported, 
and not on `toD:`.
   - All 216 tests of the ai package green.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj


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