| | |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; |
| | | import org.springframework.data.redis.serializer.StringRedisSerializer; |
| | | import redis.clients.jedis.JedisPool; |
| | | import redis.clients.jedis.JedisPoolConfig; |
| | | |
| | | import java.time.Duration; |
| | | |
| | |
| | | return template; |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | public JedisPool jedisPool() { |
| | | JedisPoolConfig poolConfig = new JedisPoolConfig(); |
| | | poolConfig.setMaxTotal(maxActive); |
| | | poolConfig.setMaxIdle(maxIdle); |
| | | poolConfig.setTestOnBorrow(true); |
| | | return new JedisPool(poolConfig, addr, port, timeout, auth, database); |
| | | } |
| | | |
| | | |
| | | } |