This commit is contained in:
xiangwbs
2018-03-15 09:09:10 +08:00
parent 6a98724bd9
commit 2e91118e50
3 changed files with 20 additions and 16 deletions
@@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
@@ -15,19 +16,20 @@ import redis.clients.jedis.JedisPoolConfig;
* 作者: xiangwb
*/
@Configuration
@PropertySource("classpath:redis.properties")
public class RedisConfig {
private final Logger logger = LoggerFactory.getLogger(RedisConfig.class);
@Value("${redis.maxTotal}")
@Value("${maxTotal}")
private Integer maxTotal;
@Value("${redis.maxIdle}")
@Value("${maxIdle}")
private Integer maxIdle;
@Value("${redis.minIdle}")
@Value("${minIdle}")
private Integer minIdle;
@Value("${redis.host}")
@Value("${host}")
private String host;
@Value("${redis.port}")
@Value("${port}")
private Integer port;
@Value("${redis.timeout}")
@Value("${timeout}")
private Integer timeOut;
@Bean
@@ -1,2 +1,13 @@
host: 192.168.11.202
port: 6379
password:
timeout: 10000
#最大连接数
maxTotal: 8
#最大空闲数
maxIdle: 8
#最小空闲数
minIdle: 0
redisCode=springboot_
systemCode=dataCenter_single
+1 -10
View File
@@ -40,21 +40,12 @@ spring:
starttls:
enable: true
required: true
#b编码
#编码
http:
encoding:
charset: UTF-8
enabled: true
force: true
#redis
redis:
host: 192.168.11.202
port: 6379
password:
timeout: 10000
maxTotal: 8 #最大连接数
maxIdle: 8 #最大空闲数
minIdle: 0 #最小空闲数
#log
logging: