davsclaus opened a new pull request, #116:
URL: https://github.com/apache/camel-jbang-examples/pull/116

   CAMEL-25763: the route rung shows the content-based router, the splitter, 
the aggregator, the filter and the multicast. This adds three EIPs users need 
often, which no example shows yet: the idempotent consumer, the content 
enricher (`pollEnrich`) and the wire tap.
   
   ## What
   
   - **`route/enrich-and-dedupe`**, with the web shop orders plus 
`resent-order-1001.json` (ORD-1001 sent twice) and `customers/` (name and tier 
per customer):
     - **`idempotentConsumer`** with an in-memory repository (a `beans` entry) 
accepts each order id once. With `skipDuplicate: false`, the resent order is 
logged as a duplicate instead of being dropped silently.
     - **`pollEnrich`** reads the customer's file with `variableReceive: 
customer`, so the order stays the body. `unmarshal` with `variableSend` and 
`variableReceive` parses the variable in place.
     - **`wireTap`** sends a copy to an `audit` route that writes 
`audit/<orderId>.json`. `audit/` is declared as data (`camel.jbang.dataDir`).
   - **README** with the usual sections, and a **Citrus YAML test** in the CI 
matrix. It is fifth in the route group. The catalog and the README tables are 
regenerated.
   
   ## A pitfall the example works around
   
   The file name for `pollEnrich` is computed into a header first. With 
`file:customers?fileName=${body[customer]}.json`, the poll fails with `Key: 
customer not found in bean: .../customers/C-482.json of type: java.io.File`. 
The reason is the file component's poll optimization (CAMEL-21733): it hands 
the `fileName` expression to the file consumer, which evaluates it against the 
polled file, and so sees the message's headers but not its body. 
`allowOptimisedComponents: false` also works. I'll raise it separately for 
Camel.
   
   ## Checks
   
   - `camel validate yaml --canonical` reports nothing.
   - The routes run on the released Camel 4.23.0 and log what the README shows. 
A `camel run --dev` reload accepts the orders again, because the repository 
bean is recreated.
   - The Citrus test passes (TEST SUCCESS).
   
   _Claude Code on behalf of davsclaus_
   
   🤖 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