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

   [CAMEL-25774](https://issues.apache.org/jira/browse/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_sample` reads 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 
idempotentConsumer` answered "no YAML sample", and the model guessed options 
that do not exist.
   
   ## What
   
   Three commits:
   
   1. **Examples in tabs** (23 pages)
      - idempotentConsumer had no example in any DSL. It gets two: skipping 
duplicates with an in-memory repository, and handling them in the route 
(`skipDuplicate: false` and `CamelDuplicateMessage`). Each declares the 
repository bean, so it works on its own.
      - pausable, resumable and tokenizer get XML and YAML tabs; 
transactional-client gets Java tabs.
      - About 48 route examples in Java or XML only are now in tabs with all 
three DSLs (aggregate, cache, dead-letter-channel, process, recipientList, 
resume-strategies, switch, toD and others). 22 stay in one DSL on purpose, as 
they explain a Java DSL detail: `end()` and `endChoice()`, nested `doTry`, 
`Map.of` for setHeaders, inline processors, the Endpoint DSL.
      - Examples that show what to avoid (the cache plumbing, a kamelet call 
the text says does not work) carry `// yaml-validator: skip`, so they are no 
sample.
      - Errors fixed along the way, for example:
        - cache: a miss detected with `body().isNull()`; a Caffeine GET keeps 
the body on a miss, so it now checks `CamelCaffeineActionHasResult`.
        - log: `.log(myLogger, "...")` does not compile.
        - aggregate: the old option name `strategyMethodAllowNull`.
        - transactional-client: `PROPAGATION_REQUIRES_MANDATORY`, and the Camel 
3 ActiveMQComponent package.
        - content-filter: an xpath with an undeclared prefix.
        - Java and XML/YAML tabs that used different endpoints, on several 
pages.
      - `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. The settings say they are written inside their EIP, not as a step.
   2. **The common usage first** (8 pages)
      - circuitBreaker: the basic example first; the exchange properties 
example below it, now with Java and XML tabs (it was YAML only).
      - claimCheck: push and pop before dynamic keys.
      - marshal and unmarshal: a JSON example first; the unmarshal one reads a 
field of the body (`${body[orderId]}`).
      - pollEnrich: a file with a timeout and no strategy first, then the 
dynamic endpoint example.
      - aggregate: an example with completionSize and completionTimeout in the 
Completion section.
      - content-filter: the expression example first.
      - split: splitting the message body second; the delimiter and expression 
examples get headings.
   3. **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 #28041 the first example of the http page 
writes `uri: "http://..."`, which failed `contains("uri: http")` on main.
   
   The catalog copies of the pages are updated.
   
   ## Checks
   
   - Every block added or changed was validated in its DSL: `camel validate 
yaml` for YAML, and `camel validate source` for XML (XML DSL schema) and Java 
(compiled). The exceptions are explained in the commits (classes outside the 
CLI classpath, the semantic extension).
   - The idempotentConsumer examples were run with `camel run` in 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` and `DocBlocksTest` 
pass. `CatalogDocJavaExamplesTest` replays every Java example against the Java 
DSL and passes.
   - camel-jbang-core: all tests pass (2307 and 237).
   
   ## Found on the way
   
   [CAMEL-25777](https://issues.apache.org/jira/browse/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.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
   


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