On Tue, Mar 19, 2013 at 11:47 AM, hefiso
<henrik.filtenborg.soren...@gmail.com> wrote:
> Hi
>
> I am using the Cache component where the elements are set to expire after,
> say, 5 minutes.
>
> However, when the component receives the operation CamelCacheCheck it does
> *not* check for expiry of the element but only checks if the element
> (expired or not) is in the cache before setting the header
> CamelCacheElementWasFound. This happens even if i specify a very low setting
> for diskExpiryThreadIntervalSeconds (say, 5 seconds).
>
> Is this design intentionally? I would assume that the TTL of the elements
> are considered when invoking CamelCacheCheck.
>
> I have solved this "quirk" by implementing a CacheEventListener acting on
> notifyElementExpired, deleting expired elements from the cache (so
> CamelCacheChec works as I expected). The CacheEventListener is then added to
> the eventListenerRegistry. Perhaps this quirk exists due to the way EHCache
> works?
>

Yeah IMHO this seems reasonable that if a cache element is expired it
should not be regarded as in the cache.

As we love contributions, then fell free to log a JIRA and provide a
patch (we prefer unit tests included)
http://camel.apache.org/contributing.html

> Best regards
> Henrik
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-cache-CamelCacheCheck-and-expiry-on-cached-elements-tp5729404.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to