| | |
| | | @Value("${spring.redis.port}") |
| | | private String port; |
| | | |
| | | // @Value("${spring.redis.password}") |
| | | // private String password; |
| | | @Value("${spring.redis.password}") |
| | | private String password; |
| | | |
| | | @Bean(destroyMethod = "shutdown") |
| | | @ConditionalOnMissingBean(RedissonClient.class) |
| | | public RedissonClient redissonClient() { |
| | | Config config = new Config(); |
| | | config.useSingleServer().setAddress("redis://" + host + ":" + port); // 更多.set |
| | | config.useSingleServer().setAddress("redis://" + host + ":" + port) |
| | | .setPassword(password); // 更多.set |
| | | return Redisson.create(config); |
| | | } |
| | | } |