I'm using spring-data-redis to connect redis server.
I want to get jedis' connection pool information via RedisConnectionFactory or RedisConnectionFactory.
But I can't found the way to get pool object from RedisConnectionFactory.
(I guess, if there's JedisConectionFactory#getPool(), i can take the connection pool object itself)
The pool
field in JedisConnectionFactory
is private and is not exposed by a getter. Your only option is to obtain the field using reflection. Besides the pool itself, you can obtain JedisPoolConfig
by calling JedisConnectionFactory.getPoolConfig()
.
Please also note that pooling is optional (enabled by default) and can be disabled by setting JedisConnectionFactory.setUsePool(false)
.