RLocalCachedMap near-cache invalidation
Latest stable Based on Bluetape4k release 1.11.0
Redisson owns both tiers
Section titled “Redisson owns both tiers”RedissonNearCache and RedissonSuspendNearCache wrap RLocalCachedMap<String, V>. Redisson manages local entries, the Redis map, and Pub/Sub invalidation instead of asking the application to compose a separate Caffeine front and Redis back.
application -> RLocalCachedMap -> local entry \----> Redis mapother client update -> Pub/Sub invalidation -> remove local entryThe default SyncStrategy.INVALIDATE removes a local entry after another client changes it. The next read loads the current Redis value and repopulates the local tier.
Clear scopes
Section titled “Clear scopes”clearLocal() clears only this wrapper’s local entries. Redis values remain and can refill the cache. clearAll() clears both tiers. close() ends the wrapper lifecycle and calls destroy(); do not use it as a data-deletion command.
Reconnect behavior
Section titled “Reconnect behavior”The default ReconnectionStrategy.CLEAR assumes invalidation events may have been missed while disconnected and clears local entries after reconnect. Choosing LOAD or another strategy requires explicit validation of event history, reconnect cost, and the stale-read budget.
Native and legacy event models
Section titled “Native and legacy event models”The native path uses fastRemove/fastRemoveAsync for multiple keys. The legacy JCache near-cache path registers entry listeners and accounts for Redisson bulk operations that do not emit the same entry events. Do not describe these two models as identical.
Metric limits
Section titled “Metric limits”Redisson does not expose a separate local-versus-Redis hit result through this wrapper. In 1.11.0, local hit/miss/eviction fields are zero, while back hit/miss fields count the integrated get result. Combine them with Redisson and Redis network metrics before judging near-cache effectiveness.