I usually get this warning at start, because I configure the client in the redis store manually:
2021-05-02 19:21:28.632 [] WARN 11160 --- [ Finalizer] i.l.c.resource.DefaultClientResources : io.lettuce.core.resource.DefaultClientResources was not shut down properly, shutdown() was not called before it's garbage-collected. Call shutdown() or shutdown(long,long,TimeUnit)
private fun redisStoreService(): StoreService {
val redisClient = RedisClient.create(databaseConfig.entityCacheRedisUrl)
return RedisStoreService.builder()
.redisClient(redisClient)
.build()
}
The Builder eagerly creates the default Redis Client, which gets overwritten by my custom one, which results in the above warning logged when eventually the defaut Redis Client is GCed.
This PR changes the Builder to lazily create the default Redis Client when it actually builds the store and none has been set.
I usually get this warning at start, because I configure the client in the redis store manually:
The Builder eagerly creates the default Redis Client, which gets overwritten by my custom one, which results in the above warning logged when eventually the defaut Redis Client is GCed. This PR changes the Builder to lazily create the default Redis Client when it actually builds the store and none has been set.