Search code examples
javaignite

apache ignite java thin client expired entry listener


Apache Ignite supports ContinuousQuery and local listener for entry events like create, put, delete. But when I try to listen for expired entry event it does not work. There code example for reproduce java thin client example.

If change event type to CREATED it's work as expected:

query.setRemoteFilterFactory((Factory<CacheEntryEventFilter<Integer, String>>) () -> e -> e.getEventType().equals(EventType.CREATED));

Does ignite java thin client supports local listener for Expired entry event type?


Solution

  • You need to configure listening for the EXPIRED event explicitly with

    query.setIncludeExpired(true)
    

    According to JavaDoc:

    Sets the flag value defining whether to notify about EventType.EXPIRED events. If true, then the remote listener will get notifications about entries expired in cache. Otherwise, only EventType.CREATED, EventType.UPDATED and EventType.REMOVED events will be fired in the remote listener. This flag is false by default, so EventType.EXPIRED events are disabled.