| 
						
						
						
						 |  | @ -1,15 +1,7 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | package com.binarywang.spring.starter.wxjava.mp.config; |  |  |  | package com.binarywang.spring.starter.wxjava.mp.config; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.binarywang.spring.starter.wxjava.mp.properties.RedisProperties; |  |  |  | import java.util.Set; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | import com.binarywang.spring.starter.wxjava.mp.enums.StorageType; |  |  |  |  | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import lombok.RequiredArgsConstructor; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import me.chanjar.weixin.common.redis.JedisWxRedisOps; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import me.chanjar.weixin.common.redis.WxRedisOps; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import me.chanjar.weixin.mp.config.WxMpConfigStorage; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl; |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | import org.apache.commons.lang3.StringUtils; |  |  |  | import org.apache.commons.lang3.StringUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.beans.factory.annotation.Value; |  |  |  | import org.springframework.beans.factory.annotation.Value; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |  |  |  | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | 
			
		
	
	
		
		
			
				
					
					|  |  | @ -17,8 +9,24 @@ import org.springframework.context.ApplicationContext; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.context.annotation.Bean; |  |  |  | import org.springframework.context.annotation.Bean; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.context.annotation.Configuration; |  |  |  | import org.springframework.context.annotation.Configuration; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.data.redis.core.StringRedisTemplate; |  |  |  | import org.springframework.data.redis.core.StringRedisTemplate; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.binarywang.spring.starter.wxjava.mp.enums.StorageType; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.binarywang.spring.starter.wxjava.mp.properties.RedisProperties; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.binarywang.spring.starter.wxjava.mp.properties.WxMpProperties; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.google.common.collect.Sets; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import lombok.RequiredArgsConstructor; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import me.chanjar.weixin.common.redis.JedisWxRedisOps; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import me.chanjar.weixin.common.redis.RedisTemplateWxRedisOps; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import me.chanjar.weixin.common.redis.WxRedisOps; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import me.chanjar.weixin.mp.bean.WxMpHostConfig; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import me.chanjar.weixin.mp.config.WxMpConfigStorage; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import me.chanjar.weixin.mp.config.impl.WxMpRedisConfigImpl; | 
			
		
	
		
		
			
				
					
					|  |  |  | import redis.clients.jedis.JedisPool; |  |  |  | import redis.clients.jedis.JedisPool; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import redis.clients.jedis.JedisPoolAbstract; | 
			
		
	
		
		
			
				
					
					|  |  |  | import redis.clients.jedis.JedisPoolConfig; |  |  |  | import redis.clients.jedis.JedisPoolConfig; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import redis.clients.jedis.JedisSentinelPool; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | /** |  |  |  | /** | 
			
		
	
		
		
			
				
					
					|  |  |  |  * 微信公众号存储策略自动配置. |  |  |  |  * 微信公众号存储策略自动配置. | 
			
		
	
	
		
		
			
				
					
					|  |  | @ -28,99 +36,113 @@ import redis.clients.jedis.JedisPoolConfig; | 
			
		
	
		
		
			
				
					
					|  |  |  | @Configuration |  |  |  | @Configuration | 
			
		
	
		
		
			
				
					
					|  |  |  | @RequiredArgsConstructor |  |  |  | @RequiredArgsConstructor | 
			
		
	
		
		
			
				
					
					|  |  |  | public class WxMpStorageAutoConfiguration { |  |  |  | public class WxMpStorageAutoConfiguration { | 
			
		
	
		
		
			
				
					
					|  |  |  |   private final ApplicationContext applicationContext; |  |  |  | 	private final ApplicationContext applicationContext; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   private final WxMpProperties wxMpProperties; |  |  |  | 	private final WxMpProperties wxMpProperties; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   @Value("${wx.mp.config-storage.redis.host:") |  |  |  | 	@Value("${wx.mp.config-storage.redis.host:") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   private String redisHost; |  |  |  | 	private String redisHost; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   @Value("${wx.mp.configStorage.redis.host:") |  |  |  | 	@Value("${wx.mp.configStorage.redis.host:") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   private String redisHost2; |  |  |  | 	private String redisHost2; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   @Bean |  |  |  | 	@Bean | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   @ConditionalOnMissingBean(WxMpConfigStorage.class) |  |  |  | 	@ConditionalOnMissingBean(WxMpConfigStorage.class) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   public WxMpConfigStorage wxMpConfigStorage() { |  |  |  | 	public WxMpConfigStorage wxMpConfigStorage() { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     StorageType type = wxMpProperties.getConfigStorage().getType(); |  |  |  | 		StorageType type = wxMpProperties.getConfigStorage().getType(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     WxMpConfigStorage config; |  |  |  | 		WxMpConfigStorage config; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     switch (type) { |  |  |  | 		switch (type) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       case Jedis: |  |  |  | 		case Jedis: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         config = jedisConfigStorage(); |  |  |  | 			config = jedisConfigStorage(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         break; |  |  |  | 			break; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       case RedisTemplate: |  |  |  | 		case RedisTemplate: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         config = redisTemplateConfigStorage(); |  |  |  | 			config = redisTemplateConfigStorage(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         break; |  |  |  | 			break; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       default: |  |  |  | 		default: | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         config = defaultConfigStorage(); |  |  |  | 			config = defaultConfigStorage(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         break; |  |  |  | 			break; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  | 		} | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     return config; |  |  |  | 		// wx host config | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  | 		if (null != wxMpProperties.getHosts() && StringUtils.isNotEmpty(wxMpProperties.getHosts().getApiHost())) { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			WxMpHostConfig hostConfig = new WxMpHostConfig(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			hostConfig.setApiHost(wxMpProperties.getHosts().getApiHost()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			hostConfig.setMpHost(wxMpProperties.getHosts().getMpHost()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			hostConfig.setOpenHost(wxMpProperties.getHosts().getOpenHost()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			config.setHostConfig(hostConfig); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		return config; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   private WxMpConfigStorage defaultConfigStorage() { |  |  |  | 	private WxMpConfigStorage defaultConfigStorage() { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     WxMpDefaultConfigImpl config = new WxMpDefaultConfigImpl(); |  |  |  | 		WxMpDefaultConfigImpl config = new WxMpDefaultConfigImpl(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     setWxMpInfo(config); |  |  |  | 		setWxMpInfo(config); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     return config; |  |  |  | 		return config; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  | 	} | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   private WxMpConfigStorage jedisConfigStorage() { |  |  |  | 	private WxMpConfigStorage jedisConfigStorage() { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     JedisPool jedisPool; |  |  |  | 		JedisPoolAbstract jedisPool; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     if (StringUtils.isNotEmpty(redisHost) || StringUtils.isNotEmpty(redisHost2)) { |  |  |  | 		if (StringUtils.isNotEmpty(redisHost) || StringUtils.isNotEmpty(redisHost2)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       jedisPool = getJedisPool(); |  |  |  | 			jedisPool = getJedisPool(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } else { |  |  |  | 		} else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       jedisPool = applicationContext.getBean(JedisPool.class); |  |  |  | 			jedisPool = applicationContext.getBean(JedisPool.class); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  | 		} | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     WxRedisOps redisOps = new JedisWxRedisOps(jedisPool); |  |  |  | 		WxRedisOps redisOps = new JedisWxRedisOps(jedisPool); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     WxMpRedisConfigImpl wxMpRedisConfig = new WxMpRedisConfigImpl(redisOps, wxMpProperties.getConfigStorage().getKeyPrefix()); |  |  |  | 		WxMpRedisConfigImpl wxMpRedisConfig = new WxMpRedisConfigImpl(redisOps, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     setWxMpInfo(wxMpRedisConfig); |  |  |  | 				wxMpProperties.getConfigStorage().getKeyPrefix()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     return wxMpRedisConfig; |  |  |  | 		setWxMpInfo(wxMpRedisConfig); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  | 		return wxMpRedisConfig; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   private WxMpConfigStorage redisTemplateConfigStorage() { |  |  |  | 	private WxMpConfigStorage redisTemplateConfigStorage() { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     StringRedisTemplate redisTemplate = applicationContext.getBean(StringRedisTemplate.class); |  |  |  | 		StringRedisTemplate redisTemplate = applicationContext.getBean(StringRedisTemplate.class); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     WxRedisOps redisOps = new RedisTemplateWxRedisOps(redisTemplate); |  |  |  | 		WxRedisOps redisOps = new RedisTemplateWxRedisOps(redisTemplate); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     WxMpRedisConfigImpl wxMpRedisConfig = new WxMpRedisConfigImpl(redisOps, wxMpProperties.getConfigStorage().getKeyPrefix()); |  |  |  | 		WxMpRedisConfigImpl wxMpRedisConfig = new WxMpRedisConfigImpl(redisOps, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     setWxMpInfo(wxMpRedisConfig); |  |  |  | 				wxMpProperties.getConfigStorage().getKeyPrefix()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     return wxMpRedisConfig; |  |  |  | 		setWxMpInfo(wxMpRedisConfig); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  | 		return wxMpRedisConfig; | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 	} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   private void setWxMpInfo(WxMpDefaultConfigImpl config) { |  |  |  | 	private void setWxMpInfo(WxMpDefaultConfigImpl config) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     WxMpProperties properties = wxMpProperties; |  |  |  | 		WxMpProperties properties = wxMpProperties; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     WxMpProperties.ConfigStorage configStorageProperties = properties.getConfigStorage(); |  |  |  | 		WxMpProperties.ConfigStorage configStorageProperties = properties.getConfigStorage(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     config.setAppId(properties.getAppId()); |  |  |  | 		config.setAppId(properties.getAppId()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     config.setSecret(properties.getSecret()); |  |  |  | 		config.setSecret(properties.getSecret()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     config.setToken(properties.getToken()); |  |  |  | 		config.setToken(properties.getToken()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     config.setAesKey(properties.getAesKey()); |  |  |  | 		config.setAesKey(properties.getAesKey()); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     config.setHttpProxyHost(configStorageProperties.getHttpProxyHost()); |  |  |  | 		config.setHttpProxyHost(configStorageProperties.getHttpProxyHost()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     config.setHttpProxyUsername(configStorageProperties.getHttpProxyUsername()); |  |  |  | 		config.setHttpProxyUsername(configStorageProperties.getHttpProxyUsername()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     config.setHttpProxyPassword(configStorageProperties.getHttpProxyPassword()); |  |  |  | 		config.setHttpProxyPassword(configStorageProperties.getHttpProxyPassword()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     if (configStorageProperties.getHttpProxyPort() != null) { |  |  |  | 		if (configStorageProperties.getHttpProxyPort() != null) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       config.setHttpProxyPort(configStorageProperties.getHttpProxyPort()); |  |  |  | 			config.setHttpProxyPort(configStorageProperties.getHttpProxyPort()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  | 		} | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  | 	} | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |   private JedisPool getJedisPool() { |  |  |  | 	private JedisPoolAbstract getJedisPool() { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     WxMpProperties.ConfigStorage storage = wxMpProperties.getConfigStorage(); |  |  |  | 		WxMpProperties.ConfigStorage storage = wxMpProperties.getConfigStorage(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     RedisProperties redis = storage.getRedis(); |  |  |  | 		RedisProperties redis = storage.getRedis(); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     JedisPoolConfig config = new JedisPoolConfig(); |  |  |  | 		JedisPoolConfig config = new JedisPoolConfig(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     if (redis.getMaxActive() != null) { |  |  |  | 		if (redis.getMaxActive() != null) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       config.setMaxTotal(redis.getMaxActive()); |  |  |  | 			config.setMaxTotal(redis.getMaxActive()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  | 		} | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     if (redis.getMaxIdle() != null) { |  |  |  | 		if (redis.getMaxIdle() != null) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       config.setMaxIdle(redis.getMaxIdle()); |  |  |  | 			config.setMaxIdle(redis.getMaxIdle()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  | 		} | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     if (redis.getMaxWaitMillis() != null) { |  |  |  | 		if (redis.getMaxWaitMillis() != null) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       config.setMaxWaitMillis(redis.getMaxWaitMillis()); |  |  |  | 			config.setMaxWaitMillis(redis.getMaxWaitMillis()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  | 		} | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     if (redis.getMinIdle() != null) { |  |  |  | 		if (redis.getMinIdle() != null) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       config.setMinIdle(redis.getMinIdle()); |  |  |  | 			config.setMinIdle(redis.getMinIdle()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  | 		} | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     config.setTestOnBorrow(true); |  |  |  | 		config.setTestOnBorrow(true); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     config.setTestWhileIdle(true); |  |  |  | 		config.setTestWhileIdle(true); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		if (StringUtils.isNotEmpty(redis.getSentinelIps())) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			Set<String> sentinels = Sets.newHashSet(redis.getSentinelIps().split(",")); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			return new JedisSentinelPool(redis.getSentinelName(), sentinels); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     return new JedisPool(config, redis.getHost(), redis.getPort(), redis.getTimeout(), redis.getPassword(), |  |  |  | 		return new JedisPool(config, redis.getHost(), redis.getPort(), redis.getTimeout(), redis.getPassword(), | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |       redis.getDatabase()); |  |  |  | 				redis.getDatabase()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  | 	} | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					
					| 
						
						
						
						 |  | 
 |