-
1. Re: Notification instead of eviction
wdfink Jul 14, 2014 3:21 PM (in response to karminder.singh)Did you mean eviction or expiration?
You can set the expiration with the hot rod api
-
2. Re: Notification instead of eviction
karminder.singh Jul 15, 2014 2:34 AM (in response to wdfink)My requirement is to get a notifcaion after the time mentioned in "put" API expires. I will do some processing based on the timeout and will then decide whether or not to remove the record.
While testing, I am receiving notifications when I delete entries explicitly from my client, but no notifications are coming when the record expires and is removed from cache.
I am using persistence mode with replication mode.
-
3. Re: Notification instead of eviction
william.burns Jul 17, 2014 7:42 AM (in response to karminder.singh)Expiration listeners are not currently implemented. The JIRA to implement that can be found here [ISPN-694] Create expiration notification for in-memory cache entries - JBoss Issue Tracker
Also the FAQs in documentation talks about this briefly http://infinispan.org/docs/7.0.x/faqs/faqs.html#_why_isn_t_there_a_notification_for_the_expiration_of_a_cache_entry It sounds like your use case is exactly what the FAQ page talks about as an issue since there is no guarantee when the expiration would fire in this case.
If you want some logic on a timer maybe try using a ScheduledThreadExecutor http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html ?