Alachisoft / NCache

NCache: Highly Scalable Distributed Cache for .NET
http://www.alachisoft.com
Apache License 2.0
647 stars 123 forks source link

Cache events are not reliable #55

Open geriadejes opened 4 years ago

geriadejes commented 4 years ago

Hello,

I'm having trouble migrating ncache to version 5.0.0 SP2. I specifically have issues with cache events, please confirm if the following remarks are correct:

  1. ItemAdded event is not working
  2. ItemUpdated event is only working for cache items which are already cached before calling MessagingService.RegisterCacheNotification
  3. If you remove an item (by removing or clearing cache), it's events are lost. If you add the item with the same key again, you have to call cache.MessagingService.RegisterCacheNotification again, otherwise the event doesn't fire.
  4. Even for the items which are in cache before calling MessagingService.RegisterCacheNotification, ItemUpdated event sometimes works, sometimes doesn't, cannot determine when exactly it stops working yet, looks like it's enough to just wait a few minutes and do nothing, and then it stops working.

My application has multiple cache clients, they all are using myreplicatedcache with default settings after installation.

Please confirm the statements number 1-3 are correct and it's the intended behavior, and please suggest what could be causing the events to stop working after a while.

Thank you, Donatas

Mark-NCache commented 4 years ago

Hi geriadejes,

Thanks for reaching out to us. Please find my response to your queries below.

  1. NCache 5.0 SP2 Open Source does not support Item level event for ItemAdded. You can find this feature in NCache Enterprise edition which you can download with a 60-day trial from the following link: https://www.alachisoft.com/download-ncache.html
  2. In NCache 5.0 SP2 Open Source, ItemUpdated notifications can only be registered for those items that are added to the cache. ItemUpdated Notifications cannot be registered against those keys which are not present in the cache as they can only be updated once they are added to the cache.
  3. The notifications registered for items are only valid till the respective items are in the cache. Once items are removed from the cache (either through NCache API Call or because of item expiration) the notifications registered against them are also removed. In order register item level notifications against the removed keys, you have to add them to the cache again.
  4. Please provide the code with which you’re able to reproduce this issue and we’ll try to reproduce it on our end and provide you with a solution.

Please do let me know if there are any questions.

Mark-NCache commented 4 years ago

Moreover, you can find theNCache edition comparison at the following link: https://www.alachisoft.com/ncache/edition-comparison.html