Expiration notification for cache entries

Latest response

As per our requirement, All cache expired entities need to be processed and some actions need to be contacted.

From studies we found that, there will not be any notification on expiry of an entry and CacheEntryRemoved is also used only entry is manually removed.

Will there be any option to get notified when entry is getting expired?

Responses

Currently there is no expiration notification by design:

https://docs.jboss.org/author/pages/viewpage.action?pageId=5832832

The expiration is done at data container level (in-memory and cache stores), it's not a cache operation. And we currently don't have a reliable way to emit expiration notifications from cache stores.

http://infinispan-developer-list.980875.n3.nabble.com/infinispan-dev-Supporting-notifications-for-entries-expired-while-in-the-cache-store-ISPN-694-td4026969.html

Also most users expected immediate expiration notifications right after expiration period has passed, but we actually can't fire it immediately. For example, calling put(A) may perform entryExpired(A) concurrently in a background thread, so sometimes entryExpired() is called after or at the same time new entry is created.

Due to these limitations we can't provide expiration notifications for now. If the notification is really necessary you need manual expiration process and remove them explicitly.

Regards,
Takayoshi

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.