davsclaus opened a new pull request, #130: URL: https://github.com/apache/camel-jbang-examples/pull/130
_Claude Code on behalf of davsclaus_ The examples now keep a value that only the route uses in a variable instead of a header. A header is sent on with the message to the next endpoint (an HTTP header, a JMS or Kafka property), so it becomes part of the data contract. A variable stays inside the exchange. Models learn this pattern from these examples, which the Camel MCP server serves (`camel_catalog_examples`). Camel's own hints now suggest a variable too (apache/camel#28500). | Example | Value | Used for | |---|---|---| | run/order-generator | `orderId` | the JSON body and the log | | transform/json-transform | `orderId`, `itemCount` | the log | | transform/csv-to-json | `invoiceId` | the log and the output file name | | route/order-lines | `orderId` | the logs, before and inside the split | | route/aggregator | `orderId` | the logs and the correlation expression | | route/enrich-and-dedupe | `customerFile` | the pollEnrich file name | - Split and aggregated messages get a copy of the variables, as they do of the headers. - The file consumer of pollEnrich evaluates `fileName` with the variables and the headers of the message. - Headers that an endpoint reads stay headers: `CamelFileName`, `Content-Type`, `CamelHttpResponseCode`, and the path parameters of rest-openapi. - The READMEs, `metadata.json` (`teaches`: `setVariable`) and the generated catalog are updated. Tested: - `camel validate yaml --canonical` passes on the six routes. - The six Citrus tests pass, run with `camel test run` (CLI 4.24.0-SNAPSHOT). The aggregator test checks the "Shipment for ORD-1001 complete" line, so the variable survives the aggregation. - `route/enrich-and-dedupe` runs on Camel 4.23.0, the version CI uses: every accepted order is logged with its customer. This is one PR for all six examples, because it is the same change in each. 🤖 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]
