当前位置:网站首页>Get jedis from jedissentinelpool

Get jedis from jedissentinelpool

2022-06-22 05:16:00 a good idea


	@Bean
	public Jedis getjedis() {
		JedisSentinelPool redisSentinelPool = null;
		redisSentinelPool = new JedisSentinelPool(master, set, redis_password, sentinel_password);
		Jedis jedis = null;
		try {
			jedis = redisSentinelPool.getResource();		
			return jedis;
		} catch (Exception e) {
 		} finally {
			if (jedis != null) {
				jedis.close();
			}
		}
		return jedis;
	}

原网站

版权声明
本文为[a good idea]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206220510552294.html