Because a redis link needs to be configured, the system’s own configuration is excluded, which are
RedisAutoConfiguration.class 和 RedisRepositoriesAutoConfiguration.class
It should be noted that:
RedisRepositoriesAutoConfiguration has a dependency on the bean whose beanName is called "redisTemplate" and needs to be excluded
@SpringBootApplication(exclude={ RedisAutoConfiguration.class, RedisRepositoriesAutoConfiguration.class })
The error message is:
Deprecated configuration property 'spring.redis.pool.max-active"
The error configuration is:
#连接池最大连接数(使用负值表示没有限制) spring.redis.pool.max-active=80 # 连接池最大阻塞等待时间(使用负值表示没有限制) spring.redis.pool.max-wait=-1 # 连接池中的最大空闲连接 spring.redis.pool.max-idle=20 # 连接池中的最小空闲连接 spring.redis.pool.min-idle=10
is because when using jedis, the prefix should be spring.redis.jedis, not spring. redis.
can be changed to the following:
# 连接池最大连接数(使用负值表示没有限制) spring.redis.jedis.pool.max-active=50 # 连接池最大阻塞等待时间(使用负值表示没有限制) spring.redis.jedis.pool.max-wait=-1 # 连接池中的最大空闲连接 spring.redis.jedis.pool.max-idle=50 # 连接池中的最小空闲连接 spring.redis.jedis.pool.min-idle=5
The above is the detailed content of How to exclude the automatic configuration of redis in springboot. For more information, please follow other related articles on the PHP Chinese website!