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

   ## Why
   
   In a benchmark run with a local model (`qwen4:35b-a3b-nvfp4`) on the 
camel-jbang-mcp server, three steps failed because the catalog and the docs did 
not give the model what it needed:
   
   1. **Write the lines that cannot be read to a rejects file, as they are in 
the file.** The model used `onException` and wrote `${body}`, which at that 
point is the parsed Map, not the line. `useOriginalBody: true` solves it 
(inside a Splitter the onException steps then get the split line, checked with 
`camel run`), but its description talks only about the dead letter queue.
   2. **Log "done: <n> lines" when the whole file is read.** The Split page has 
no example of doing something at the last split message. The model logged after 
the split with a variable set inside it, which does not reach the exchange 
after the split.
   3. **A Dynamic Router.** The catalog listed no exchange properties for 
dynamicRouter. The model made up a property (`CamelDynamicRouterSlipEndpoint`) 
to stop the router, and the route looped.
   
   ## Changes
   
   - `OnExceptionDefinition`: `useOriginalMessage` and `useOriginalBody` now 
say what the steps of the onException get: the message as it came in, and 
inside a Splitter the split message, such as the line.
   - `split-eip.adoc`: a new section "Doing something after the last split 
message", in Java, XML and YAML tabs. It uses a Filter on `CamelSplitComplete` 
and logs `CamelSplitSize`, which also works in streaming mode. The YAML example 
was run with `camel run`.
   - `Exchange.SLIP_ENDPOINT` (`CamelSlipEndpoint`): the label is now 
`routingSlip,dynamicRouter`, as `DynamicRouter` extends `RoutingSlip` and sets 
it too. The description says that it is not set before the first endpoint, so 
an expression can use it to stop.
   - Regenerated: the catalog and core-model JSON, the XSDs, the YAML DSL 
schema and deserializers, and the EIP samples.
   
   ## Tests
   
   - Full reactor build (`-Dquickly`) passes; formatting is clean.
   - camel-jbang-core ai tests: 1131 run, 0 failures.
   - A check run of 3 rounds with the model: in one round it read the new Split 
section, used `CamelSplitComplete`, and the step passed.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDi5iQNgtHrDdz2NpwF
   


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