Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does springboot exclude the automatic configuration of redis

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "how to exclude the automatic configuration of redis from springboot". Xiaobian shows you the operation process through actual cases. The operation method is simple, fast and practical. I hope this article "how to exclude the automatic configuration of redis from springboot" can help you solve the problem.

Springboot excludes automatic configuration of redis

Because you want to configure a redis link, so exclude the configuration that comes with the system, respectively

RedisAutoConfiguration.class and RedisRepositoriesAutoConfiguration.class are two autoconfiguration classes

Note:

RedisRepositoriesAutoConfiguration has dependencies on beans with beanName called "redisTemplate", which need to be excluded together

@SpringBootApplication(exclude={ RedisAutoConfiguration.class, RedisRepositoriesAutoConfiguration.class})springboot configurationredis error (redline)Deprecated configuration property "spring.redis.pool.max-active"

The error message is:

Deprecated configuration property 'spring.redis.pool.max-active"

Error configuration is:

#Maximum connections in a connection pool (use negative values to indicate no limit) spring.redis.pool.max-active=80#Maximum blocking wait time in a connection pool (use negative values to indicate no limit) spring.redis.pool.max-wait=-1#Maximum free connections in a connection pool spring.redis.pool.max-idle=20#Minimum free connections in a connection pool spring.redis.pool.min-idle= 10Analysis

This is because in the case of jedis, the prefix should be spring.redis.jedis, not spring.redis.

It would read as follows:

#Maximum number of connections in connection pool spring.redis.jedis.pool.max-active=50#connection pool maximum blocking latency (Use negative values to indicate no restrictions) spring.redis.jedis.pool.max-wait=-1#Maximum free connection in the connection pool spring.redis.jedis.pool.max-idle=50#Minimum free connection in the connection pool spring.redis.jedis.pool.min-idle=5 The content of "How to exclude automatic configuration of redis from springboot" is introduced here. Thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the industry information channel. Xiaobian will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report