1、@EnableConfigurationProperties註解的做用redis
@Configuration @ConditionalOnClass(RedisOperations.class) @EnableConfigurationProperties(RedisProperties.class) @Import({ LettuceConnectionConfiguration.class, JedisConnectionConfiguration.class }) public class RedisAutoConfiguration { ... }
RedisProperties類上沒有加@Component等註解,也能夠註冊到Spring容器中
@ConfigurationProperties(prefix = "spring.redis") public class RedisProperties { ... }