标签:oar redis配置 data string contex cto class tor pack
@Component 生成组建
@ConfigurationProperties(prefix="redis") 读写redis配置文件
application.properties配置文件
#redis redis.host=127.0.0.1 redis.port=6379 redis.timeout=3 redis.password= redis.poolMaxTotal=10 redis.poolMaxIdle=10 redis.poolMaxWait=3
package com.java.seckill.redis; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Component @ConfigurationProperties(prefix="redis") @AllArgsConstructor @NoArgsConstructor @Data public class RedisConfig { private String host; private Integer port; private Integer timeout; private String password; private Integer poolMaxTotal; private Integer poolMaxIdle; private Integer poolMaxWait; }
标签:oar redis配置 data string contex cto class tor pack
原文地址:https://www.cnblogs.com/wuxiang12580/p/10326199.html