Skip to content
Bluetape4k docs1.11

Configuration, codecs, and client ownership

Latest stable Based on Bluetape4k release 1.11.0

Setting1.11.0 defaultMeaning
cacheNameredisson-near-cacheRedis map name
maxLocalSize10_000Maximum local entries per JVM
timeToLivenullNo Redis TTL
maxIdlenullNo idle expiry
syncStrategyINVALIDATEInvalidate after another client writes
reconnectionStrategyCLEARClear local entries after reconnect
evictionPolicyLRULocal eviction policy

Use a service/data/environment-specific name instead of the default. With both durations unset, Redis entries do not expire because of time.

Names cannot be blank, local size must be positive, and configured TTL/idle durations must be greater than zero.

val config = redissonNearCacheConfig {
cacheName = "catalog:products:v1"
maxLocalSize = 2_000
timeToLive = Duration.ofMinutes(15)
maxIdle = Duration.ofMinutes(5)
}

TTL applies to Redis entries. Local size and eviction apply to each JVM. They are not two spellings of one capacity limit.

The default near-cache codec is RedissonCodecs.LZ4Fory. A codec is a wire format, not just a compression toggle. If old and new deployments share one map with incompatible codecs, reads can fail. Use a compatible rollout or versioned map names.

JCache Configuration<K, V> also carries key/value types, expiry, loader, and writer. Reopening an existing name does not guarantee that a new configuration replaces the old one.

Usually the DI container creates and closes one RedissonClient. Near-cache close() and memoizer clear() do not shut it down. Config-based JCache creation can involve provider-owned clients, so verify the global manager/provider lifecycle separately and isolate test cache names.