Repository navigation
CAMEL-25774: EIP docs - route examples in tabs with Java, XML and YAML, an idempotent consumer example, and the common usage first - #28079
Conversation
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM. Well-structured PR that adds multi-tab Java/XML/YAML examples to ~28 EIP doc pages and extends the CatalogSamples lookup logic for EIPs whose samples live on other pages. Code is correct, test coverage is solid, and the idempotentConsumer YAML examples are valid and match the test assertions.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
…L, an example for the idempotent consumer, and samples for loadBalance and the EIP settings - idempotentConsumer had no example in any DSL. It now has two, in Java, XML and YAML: skipping the duplicates with an in-memory repository, and handling them in the route (skipDuplicate false and CamelDuplicateMessage). - pausable, resumable and tokenizer get XML and YAML tabs next to the Java ones, and transactional-client gets Java tabs. - The route examples that were in Java or XML only now sit in tabs with all three DSLs (aggregate, cache, dead-letter-channel, process, recipientList, resume-strategies, switch, toD and others). What is left in one DSL explains a Java DSL detail, such as end() and endChoice(). - An example that shows what to avoid is marked so the AI tools do not offer it as a sample. - Errors in the existing examples are fixed, such as a cache miss detected with body().isNull() (a Caffeine GET keeps the body on a miss), a log(Logger, String) call that does not exist, the old option name strategyMethodAllowNull, PROPAGATION_REQUIRES_MANDATORY, and Java and XML/YAML tabs that used different endpoints. - camel_catalog_sample answers loadBalance with the examples of the load balancer policy pages, the circuit breaker settings with those of the Resilience4j and Fault Tolerance pages, and batchConfig and streamConfig with those of the resequence page: the examples that write them, the first of each page first. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
…usage
camel_catalog_sample returns the first examples of a page (two by default), so they should show what most routes do.
- circuitBreaker: the basic example comes first; the one that reads the exchange properties in the fallback moves
below it, and gets Java and XML tabs (it was YAML only).
- claimCheck: the push and pop example comes before dynamic keys.
- marshal and unmarshal: a JSON example first (with Jackson). The unmarshal one shows reading a field of the
unmarshalled body, such as ${body[orderId]}.
- pollEnrich: a basic example first, a file with a timeout and no aggregation strategy, then the dynamic endpoint
example that uses a header.
- aggregate: the Completion section has an example that combines completionSize and completionTimeout, with the
GroupedBodyAggregationStrategy, ahead of the aggregate controller.
- content-filter: the expression example comes first.
- split: splitting the message body comes second, after the tokenizer example; the delimiter and expression examples
get their own headings.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
…nd the sample tests follow the new examples - eip-samples.json now has samples for idempotentConsumer, pausable, resumable, tokenizer and the resume strategies, and the reordered and new examples of the other pages. - The tests that used pausable and dedup as EIPs without a sample now expect their samples; a tokenizer implementation is the EIP without one. - The http sample test accepts a quoted uri: the GET example of the http page (CAMEL-25745) writes toD with uri: "http://...", which failed contains("uri: http") on main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
0c6c86b to
f1eb1ba
Compare
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
The modelName attribute of the LangChain4j tokenizers was required in the XML schemas, while the model metadata, the Java DSL and the YAML DSL have it optional: without it the segment sizes are counted in characters. It is now optional in camel-spring.xsd and camel-xml-io.xsd as well, so the tokenizer example without a model validates. The Semantic example of the switch page declares its evaluations with <semantic>, which camel-semantic loads outside the core schemas, so DocExamplesXmlSchemaTest skips that example as it does on the Semantic language page. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
gnodet-bot
left a comment
There was a problem hiding this comment.
Previous findings are all addressed. LGTM.
The new commit (9652d343) fixes a schema mismatch for the LangChain4j tokenizer's modelName attribute: @XmlAttribute(required = true) → @XmlAttribute in the Java model, aligning it with the existing @Metadata(required = false). The change is consistent across all 14 affected artifacts — both XSD schemas (camel-spring.xsd, camel-xml-io.xsd) and all 10 JSON catalog files (5 in catalog/, 5 in core/). The switch-eip skip added to DocExamplesXmlSchemaTest correctly follows the same pattern as semantic-language — extension-owned schema elements that aren't in the core XSD. Null safety of the now-optional modelName field is handled in SplitterUtil.buildTokenizer() which already checks for null before constructing the estimator.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
✅ Generated files are up to dateAn earlier CI run reported uncommitted generated changes; the latest run no longer does. |
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 567 of 707 tested, 24 compile-only — current: 567 all testedMaveniverse Scalpel detected 567 affected modules (current approach: 567). Skip-tests mode would test 567 modules (5 direct + 565 downstream), skip tests for 24 (generated code, meta-modules) Modules Scalpel would test (567)
Modules with tests skipped (24)
💡 Manual integration tests recommended:
Build reactor — dependencies compiled but only changed modules were tested (5 modules, 58.3s total)Total reactor time: 58.3s
Top 20 slowest modules:
|
CAMEL-25774: the EIP pages show their route examples in tabs with Java, XML and YAML, the idempotent consumer has an example, and the first examples of a page show the common usage. The AI tools'
camel_catalog_samplereads these YAML examples, and returns the first two of a page by default.In a benchmark of Oct 18-19 (a local model building new examples), the step that adds an idempotent consumer passed 1 of 6 times:
camel_catalog_sample idempotentConsumeranswered "no YAML sample", and the model guessed options that do not exist.What
Four commits:
Examples in tabs (23 pages)
skipDuplicate: falseandCamelDuplicateMessage). Each declares the repository bean, so it works on its own.end()andendChoice(), nesteddoTry,Map.offor setHeaders, inline processors, the Endpoint DSL.// yaml-validator: skip, so they are no sample.body().isNull(); a Caffeine GET keeps the body on a miss, so it now checksCamelCaffeineActionHasResult..log(myLogger, "...")does not compile.strategyMethodAllowNull.PROPAGATION_REQUIRES_MANDATORY, and the Camel 3 ActiveMQComponent package.camel_catalog_sampleanswers loadBalance with the examples of the load balancer policy pages, the circuit breaker settings with those of the Resilience4j and Fault Tolerance pages, and batchConfig and streamConfig with those of the resequence page: the examples that write them, the first of each page first. The settings say they are written inside their EIP, not as a step.The common usage first (8 pages)
${body[orderId]}).camel-jbang: the shipped samples (
eip-samples.json) are regenerated, and the sample tests follow the new examples. The http sample test now accepts a quoted uri: since CAMEL-25745: camel-http - make it stand out that a message with a body is sent as a POST unless httpMethod is set #28041 the first example of the http page writesuri: "http://...", which failedcontains("uri: http")on main.The XML examples validate (
DocExamplesXmlSchemaTestfailed on two of the new XML tabs)modelNameof the LangChain4j tokenizers was@XmlAttribute(required = true)while its@Metadatasaysrequired = false(a slip from CAMEL-22096). The Java DSL and the YAML DSL already have it optional; without it the segment sizes are counted in characters. It is now optional incamel-spring.xsdandcamel-xml-io.xsdtoo, so the example without a model validates.<semantic>, which camel-semantic loads outside the core schemas, so the test skips that example as it does on the Semantic language page.The catalog copies of the pages are updated.
Checks
camel validate yamlfor YAML, andcamel validate sourcefor XML (XML DSL schema) and Java (compiled). The exceptions are explained in the commits (classes outside the CLI classpath, the semantic extension).camel runin YAML (both), XML (the second) and Java (the first), with message ids A, B, A, C: the second A is skipped, or logged as a duplicate.EipDocExamplesTest,UserManualDocExamplesTest,DocBlocksTestandDocExamplesXmlSchemaTestpass; camel-catalog: all tests pass (1103).CatalogDocJavaExamplesTestreplays every Java example against the Java DSL and passes.Found on the way
CAMEL-25777: the tokenizer EIP fails in XML and YAML routes, as only the Java DSL sets the tokenizer name (confirmed with
camel run:NullPointerException: jar). The new XML and YAML tabs of the tokenizer page follow the schema, and run once that is fixed.🤖 Generated with Claude Code
https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m