当我使用spring-data-redis注入RedisConnectionFactory并设置poolConfig时,如何在运行时获取池的信息,因为我发现工厂没有公开池。谢谢你提前。^。^
我的代码是:
@Bean
public RedisConnectionFactory jedisConnectionFactory() {
JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxIdle(128);
poolConfig.setJmxEnabled(true);
poolConfig.setMaxTotal(8);
poolConfig.setMinIdle(2);
JedisConnectionFactory factory = new JedisConnectionFactory(poolConfig);
factory.setHostName("localhost");
factory.setPort(6379);
factory.setUsePool(true);
return factory;
}