[
https://issues.apache.org/jira/browse/CAMEL-12538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492782#comment-16492782
]
Andrea Cosentino commented on CAMEL-12538:
------------------------------------------
You can obtain something like that by specifying your cache:
{code:java}
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
from("direct://start").toF("caffeine-cache://%s?cache=#cache&action=PUT&key=1",
"test").toF("caffeine-cache://%s?cache=#cache&key=1&action=GET",
"test").log("Test! ${body}")
.to("mock:result");
}
};
}
{code}
In this way you'll always use the same cache you instantiated at the beginning,
otherwise it will be created on each operation. WDYT?
> camel-caffeine: do not use different caches with slightly different URIs
> ------------------------------------------------------------------------
>
> Key: CAMEL-12538
> URL: https://issues.apache.org/jira/browse/CAMEL-12538
> Project: Camel
> Issue Type: Bug
> Components: camel-caffeine
> Affects Versions: 2.21.1
> Reporter: Nicola Ferraro
> Assignee: Andrea Cosentino
> Priority: Major
>
> I've found a problem with caffeine-cache. When I use the following:
> {code:java}
> // route 1
> .to("caffeine-cache:global?key=x&action=PUT")
> // route 2
> .to("caffeine-cache:global?key=x&action=GET"{code}
> I expect that what I save in route 1 can be retrieved in route 2, but this is
> not the case, since the two URIs differ (GET/PUT) and I get two different
> caches.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)