I have the following code snippet which for getting the RedisTemplate.
@Bean
public JedisConnectionFactory getJedisConnectionFactory() {
RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration();
redisStandaloneConfiguration.setHostName(host);
if (!StringUtils.isEmpty(password)) {
redisStandaloneConfiguration.setPassword(RedisPassword.of(password));
}
redisStandaloneConfiguration.setPort(port);
return new JedisConnectionFactory(redisStandaloneConfiguration, getJedisClientConfiguration());
}
@Bean
public RedisTemplate redisTemplate() {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>();
redisTemplate.setConnectionFactory(getJedisConnectionFactory());
redisTemplate.setKeySerializer(new StringRedisSerializer());
return redisTemplate;
}
My question how sprint-boot will understand the Connection pooling because I have not provided any information in my factory about the connection pool. My application properties file has the following properties.
redis.host=<redis-host>
redis.port=<port>
redis.password=<password>
redi.jedis.pool.max.total=16
redi.jedis.pool.max.idle=8
redi.jedis.pool.min.idle=4