You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Balazs Szeti (JIRA)" <ji...@apache.org> on 2019/01/24 01:14:00 UTC
[jira] [Comment Edited] (CAMEL-13119) Create Cache Policy for
routes
[ https://issues.apache.org/jira/browse/CAMEL-13119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16750508#comment-16750508 ]
Balazs Szeti edited comment on CAMEL-13119 at 1/24/19 1:13 AM:
---------------------------------------------------------------
Any suggestions which package/module to use for the CachePolicy? I haven't seen a place for Policy classes in general.
Is it OK to add the CachePolicy in the camel-jcache component's repo? Maybe org.apache.camel.component.jcache.policy.CachePolicy?
was (Author: balazsszeti):
Any suggestions which package/module to use for the CachePolicy? I haven't seen a place for Policy classes in general.
Is it OK to add the CachePolicy in the camel-jcache component's repo? Maybe org.apache.camel.component.jcache.CachePolicy?
> Create Cache Policy for routes
> ------------------------------
>
> Key: CAMEL-13119
> URL: https://issues.apache.org/jira/browse/CAMEL-13119
> Project: Camel
> Issue Type: New Feature
> Components: camel-jcache
> Reporter: Balazs Szeti
> Priority: Major
>
> Let's write a Policy for camel routes that can cache the "result" of a route and execute the route next time only if nothing is found in the cache.
>
> Related to cache DSL idea, but without DSL change: https://issues.apache.org/jira/browse/CAMEL-11114
>
> In the first draft the CachePolicy would cache the Message Body by a key calculated via an Expression.
> Interface:
> * cachePolicy.setCacheManager( cacheManager ) - set the CacheManager. If not set, try lookup automatically.
> * cachePolicy.setCacheName ( name ) - Will use this cache from the CacheManager. If not set, we can use the route id by default.
> * cachePolicy.setKeyExpression( expression ) - Camel expression that is evaluated on the Exchange to determine the cache key. If it's found in the cache, the route is not executed and the cached value is set as Body. Otherwise the Message Body is added to the cache after the route with this key.
>
> An earlier related implementation: [https://gist.github.com/bszeti/552bf7a1f05a75fc2964a4ce7ce889b5]
> and how it can be used in a route: [https://gist.github.com/bszeti/4f855cd80cd69e3953ff990b0ae056a2]
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)