This examples demonstrate how to use Caffeine cache in a Camel K integration.
You can find more information about Apache Camel and Apache Camel K on the official Camel website.
Read the general instructions in the root README.md file for setting up your environment and the Kubernetes cluster before looking at this example.
Make sure you've read the installation instructions for your specific cluster before starting the example.
camel-caffeine.yaml defines a route that every second:To see the logs in the terminal, run the integration in dev mode:
kamel run --dev camel-caffeine.yaml
The following should be logged continuously to the terminal:
[1] 2022-06-24 12:58:06,352 INFO [route1] (Camel (camel-1) thread #1 - timer://tick) Result of Action PUT with key 1 is: Hello [1] 2022-06-24 12:58:06,355 INFO [route1] (Camel (camel-1) thread #1 - timer://tick) Result of Action GET with key 1 is: Hello [1] 2022-06-24 12:58:06,355 INFO [route1] (Camel (camel-1) thread #1 - timer://tick) Invalidating entry with key 1 [1] 2022-06-24 12:58:06,357 INFO [route1] (Camel (camel-1) thread #1 - timer://tick) The Action GET with key 1 has result? false