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

   Closes #150
   
   A new example on the `route` rung for the Cache EIP, new in Camel 4.23, with 
the shop story: each order needs its customer from a slow customer service.
   
   - A `cache` block with the customer id as the key and `ttl` (ten seconds): 
the service is called once per customer, and each order line says whether the 
customer came from the service or from the cache.
   - `convertBodyTo: String` at the end of the block stores the customer as 
text, not as the HTTP stream.
   - The store is a named `MemoryKeyValueRepository` bean; a customer-changed 
notice removes the customer with a `bean` call to `delete`.
   - A 404 for an unknown customer fails inside the block, so it is never 
cached; a `doTry` around the block logs it.
   - The notice is a file in the same `incoming/` folder as the orders, read in 
name order, so the log and the test do not depend on timing.
   
   Checked locally: `camel validate yaml --canonical` reports nothing, `camel 
run *` logs what the README shows, and `camel test run` passes with Camel 
4.23.0 (the version CI uses). The test is added to `build.yml`, and 
`./generate-catalog.sh` updated the catalog and the README tables.
   
   Known: Camel 4.23.0 logs a WARN at startup, `Could not register service: 
BeanProcessor[...MemoryKeyValueRepository...] as Service MBean` 
(`@ManagedAttribute` on `size()`). It is harmless here, and a Camel fix is 
needed for it.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 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