lancerdima commented on issue #1984: URL: https://github.com/apache/camel-k/issues/1984#issuecomment-772399778
Maybe I am missing the whole point of camel-caffeine, but it fails to cache value between multiple executions of the same flow. Consider the snippet below. The point of the snippet, is to display "cached" value from previous execution first, and then update the cache with the new one. ``` import org.apache.camel.builder.RouteBuilder; public class Caffeine extends RouteBuilder { @Override public void configure() throws Exception { from("timer:offsetHandler?fixedRate=true&period=10000&delay=5000") .to("caffeine-cache://cache?key=offset&action=GET") .log("Old value: ${body}") .setBody(simple("${headers.CamelTimerCounter}")) .to("caffeine-cache://cache?action=PUT&key=offset") .log("New value: ${body}"); } } ``` Output log indicate that value from previous execution is lost: ``` [1] 2021-02-03 10:13:15,031 INFO [route1] (Camel (camel-1) thread #0 - timer://offsetHandler) Old value: [1] 2021-02-03 10:13:15,033 INFO [route1] (Camel (camel-1) thread #0 - timer://offsetHandler) New value: 1 [1] 2021-02-03 10:13:25,018 INFO [route1] (Camel (camel-1) thread #0 - timer://offsetHandler) Old value: [1] 2021-02-03 10:13:25,021 INFO [route1] (Camel (camel-1) thread #0 - timer://offsetHandler) New value: 2 [1] 2021-02-03 10:13:35,017 INFO [route1] (Camel (camel-1) thread #0 - timer://offsetHandler) Old value: [1] 2021-02-03 10:13:35,018 INFO [route1] (Camel (camel-1) thread #0 - timer://offsetHandler) New value: 3 [1] 2021-02-03 10:13:45,017 INFO [route1] (Camel (camel-1) thread #0 - timer://offsetHandler) Old value: [1] 2021-02-03 10:13:45,018 INFO [route1] (Camel (camel-1) thread #0 - timer://offsetHandler) New value: 4 ``` Not sure whether it is camel-caffeine problem, or a discrepancy in how Camel K vs classic Camel behaves. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org