public void setConnectionRequestTimeout(Integer connectionRequestTimeout) {
this.connectionRequestTimeout = connectionRequestTimeout;
}
public Integer getSocketTimeout() {
return socketTimeout;
}
public void setSocketTimeout(Integer socketTimeout) {
this.socketTimeout = socketTimeout;
}
}
http:
最大连接数
maxTotal: 100
并发数
defaultMaxPerRoute: 20
connectTimeout: 10000
connectionRequestTimeout: 500
socketTimeout: 10000
- @PropertySource+@Value
@Component
@PropertySource(value = { “config/http-config.properties”})
public class HttpClientParam {
@Value("${http.maxTotal}")
private Integer maxTotal;
public String getMaxTotal() {
return maxTotal;
}
public void setMaxTotal(String maxTotal) {
this.maxTotal = maxTotal;
}
}
[](()Spring Boot 支持哪些日志框架?推荐和默认的日志框架是哪个?
Spring Boot支持Java Util Logging,Log4j2,Lockback作为日志框架,如果你使用starters启动器,Spring Boot将使用Logback作为默认日志框架。无论使用哪种日志框架,Spring Boot都支持配置将日志输出到控制台或者文件中。
spring-boot-starter启动器包含spring-boot-starter-logging启动器并集成了slf4j日志抽象及Logback日志框架。
[](()属性配置日志
Spring Boot支持属性配置日志参数,这个不是很灵活,不细讲。
参考配置:
LOGGING
logging.config= # Location of the logging configuration file. For instance classpath:logback.xml
for Logback
logging.exception-conversion-word=%wEx # Conversion word used when logg