davsclaus opened a new issue, #150:
URL: https://github.com/apache/camel-jbang-examples/issues/150

   Camel 4.23 added the Cache EIP (CAMEL-11114 (Cache EIP)): a `cache` block 
with a key expression keeps the result of its steps for a time to live, and 
skips the steps on a hit. No example uses it yet, and it came after the 
training data of today's models, so a model has to find it through the catalog 
and the docs instead of building a cache by hand with a cache component's 
headers.
   
   Proposed example, `route/cache`, with the shop story: each order needs its 
customer from a slow customer service (a `platform-http` route in the same 
example).
   
   Build it step by step:
   1. Call the customer service for each order.
   2. Keep the answer per customer for ten seconds, and log whether it came 
from the service or from the cache.
   3. A customer-changed notice removes that customer from the cache (`delete` 
on the named `KeyValueRepository`).
   4. A customer the service does not know (404) is logged and never cached.
   
   The example uses the in-memory store. A store outside the app, such as 
Redis, writes its values with Java serialization today, and a stream body 
cannot be stored at all (CAMEL-27763 (KeyValueRepository without Java 
serialization)). That can be a follow-up once CAMEL-27763 is fixed.
   
   With a Citrus YAML test, run with `camel test run`.
   
   _Claude Code on behalf of davsclaus_


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