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

   Fixes https://issues.apache.org/jira/browse/CAMEL-24752
   
   The runtime cannot tell which jar a missing component, language, data format 
or built-in bean is in: the metadata that knows ships inside the jar that is 
absent. And guessing `camel-<name>` is wrong for 103 of 407 component schemes 
(`aws2-ddbstream → camel-aws2-ddb`, `class → camel-bean`, `coaps → 
camel-coap`), 14 of 28 languages (`xquery → camel-saxon`, `spel → 
camel-spring`, `java → camel-joor`) and 25 of 56 data formats.
   
   So, like `SensitiveUtils`, the table is generated from the catalog at build 
time and the errors use it:
   
   ```
   No endpoint could be found for: kafka://myTopic, please check your classpath 
contains the needed Camel component jar
     (the kafka component is in camel-kafka; add camel-kafka to the classpath 
(camel-kafka-starter on Spring Boot, camel-quarkus-kafka on Quarkus)).
   
   No endpoint could be found for: kafak://myTopic, please check your classpath 
contains the needed Camel component jar
     (not a built-in Camel component; did you mean 'kafka'?).
   
   No language could be found for: xquery (the xquery language is in 
camel-saxon; add camel-saxon to the classpath (camel-saxon-starter on Spring 
Boot, camel-quarkus-saxon on Quarkus))
   
   Data format 'jaxb' could not be created. Ensure that ... (the jaxb data 
format is in camel-jaxb; add camel-jaxb to the classpath (...))
   
   Unknown expression with id: simpel (not a built-in Camel language; did you 
mean 'simple'?)
   ```
   
   ### Changes
   
   - **camel-util** — `ArtifactUtils`: four tables between `START`/`END` tokens 
(component scheme incl. alternative schemes, language, data format, built-in 
bean → artifactId), `componentHint` / `languageHint` / `dataFormatHint`, 
`dependencyHint` (names the Spring Boot starter and Quarkus extension; core 
artifacts say "part of camel-core"), and a Damerau-Levenshtein `closest()` (1 
edit for names up to 3 chars, otherwise 2 or a third of the length)
   - **camel-package-maven-plugin** — `update-artifact-helper` goal, bound in 
`catalog/camel-catalog` next to `update-sensitive-helper`. Two-pass like the 
other `update-*-helper` goals; idempotent and formatter stable (the goal was 
run twice and camel-util formatted with no diff)
   - **camel-api** — `NoSuchEndpointException` and `NoSuchLanguageException` 
append the hint; the `e.g. camel-<name>` guess is gone
   - **camel-core-reifier** — `DataFormatReifier` appends it for a model data 
format whose jar is missing and for a `custom(ref)` that names a built-in data 
format
   - **camel-yaml-dsl** — the generated `Unknown expression with id` error says 
the nearest language
   
   The `PojoBeanHelper` fallback from #26455 (`ZipAggregationStrategy is in 
camel-zipfile`) is not in this PR; 
`ArtifactUtils.beanArtifact/beanJavaType/beanInterface` are ready for it once 
that one is merged.
   
   ### Tests
   
   `ArtifactUtilsTest` (8), `DataFormatMissingJarHintTest` (3), new cases in 
`DefaultCamelContextTest`, `SimpleSyntaxHintsTest` and `ExpressionTest.groovy`; 
three existing exact-message assertions updated (`DefaultCamelContextTest`, 
`SpringDeadLetterChannelInvalidDeadLetterUriTest`, `SimpleSyntaxHintsTest`). 
Ran camel-util, the affected camel-core packages (2037 tests), the spring-xml 
test and the full camel-yaml-dsl suite (423) — all green.
   
   _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: [email protected]

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

Reply via email to