-
Bug
-
Resolution: Done
-
Major
-
6.0.0.Final, 7.0.0.Alpha1
-
None
When setting Flag.SKIP_LISTENER_NOTIFICATION, listener still can be invoked when new entry is created or entry is modified.
I check the change log and found it should be caused by logic in CacheNotifierImpl, it did not check the flag on createEntry and modifyEntry event.
You can reproduce it by the code below:
public class TestInfinispan {
public static void main(String[] args)
{ Cache<String, String> testCache = new DefaultCacheManager().getCache(); testCache.addListener(new TestListener()); AdvancedCache<String, String> advancedCache = testCache.getAdvancedCache(); advancedCache = advancedCache.withFlags(Flag.SKIP_LISTENER_NOTIFICATION); advancedCache.put("key1", "value1"); advancedCache.replace("key1", "value2"); } @Listener
private static class TestListener {
@CacheEntryModified
public void cacheEntryModified(CacheEntryModifiedEvent event)
@CacheEntryCreated
public void cacheEntryCreated(CacheEntryCreatedEvent event)
}
}
- is related to
-
ISPN-9714 Update CacheNotifier to return CompletionStage
- Closed