Search code examples
javaignite

When do we expect Ignite to trigger the EVT_CACHE_ENTRY_CREATED and EVT_CACHE_OBJECT_PUT events


What is the difference between the event types EVT_CACHE_ENTRY_CREATED and EVT_CACHE_OBJECT_PUT? When exactly they are triggered?

Going by the name, it looks like both events are triggered when new entries are added in Ignite cache, but what should be the correct event we should be listening to if we have to do some action when new entries added to cache?


Solution

  • EVT_CACHE_ENTRY_CREATED: This event is fired when the cache entry is created.
    EVT_CACHE_OBJECT_PUT: This event is fired when the writing to the cache actually happens.

    You should listen to EVT_CACHE_OBJECT_PUT since you are wanting to get changes to the cache (when an entry is added in particular).