| | |
| | | } |
| | | } |
| | | |
| | | @Bean(name = "jedisCluster") |
| | | @Autowired |
| | | |
| | | // @Bean(name = "jedisCluster") |
| | | // @Autowired |
| | | public JedisCluster jedisCluster(@Qualifier("jedis.pool.config") JedisPoolConfig config, |
| | | @Value("${jedis.pool.host}") String host, |
| | | @Value("${jedis.pool.port}") int port, |
| | |
| | | if (timeout == 0) { |
| | | timeout = 2000; |
| | | } |
| | | if (!host.contains(",")) { |
| | | return null; |
| | | } |
| | | |
| | | String[] hosts = host.split(","); |
| | | Set<HostAndPort> nodes = new HashSet<>(); |
| | | String[] tmpHosts = null; |
| | |
| | | } |
| | | JedisCluster cluster = new JedisCluster(nodes); |
| | | return cluster; |
| | | |
| | | } |
| | | |
| | | @Bean(name = "jedis.pool.config") |