Can near cache invalidation be made synchronous or is it always asynchronous? #70
-
I have looked at the documentation for Near Cache and found info about the various invalidation modes but I do not find it spelled out clearly if the invalidations in the local part of the near cache when the distributed tier is updated are synchronous or asynchronous? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This is an interesting one, and if you dig into the code you may get a wrong impression ;-)
So to answer your question, no we don't support truly synchronous invalidation (or any other kind of) events, as they would be quite expensive in large clusters, with many listeners involved. |
Beta Was this translation helpful? Give feedback.
This is an interesting one, and if you dig into the code you may get a wrong impression ;-)
NearCache
usesSynchronousListener
to receive invalidation events, which may lead you to believe that the invalidation is indeed synchronous. However, that's not the case -- all that means is that the events will be processed by the service thread that received them, instead of being queued up to be dispatched by the event dispatcher thread, as the events for regularMapListeners
are. This ensures in order delivery of events for a given member, but it doesn't make the event notification itself truly "synchronous" across the cluster.So to answer your question, no we don't support truly synchronous …