com.eworkcloud.okhttp.OkHttpProperties Maven / Gradle / Ivy
package com.eworkcloud.okhttp;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
@Getter
@Setter
@ConfigurationProperties(prefix = "okhttp")
public class OkHttpProperties {
/**
* 连接超时(秒)
*/
private int connectTimeout = 10;
/**
* 读取超时(秒)
*/
private int readTimeout = 10;
/**
* 写入超时(秒)
*/
private int writeTimeout = 10;
/**
* http重定向
*/
private boolean followRedirects = true;
/**
* https重定向
*/
private boolean followSslRedirects = true;
/**
* 连接失败时重试
*/
private boolean retryOnConnectionFailure = true;
/**
* 连接池
*/
private Pool pool;
@Getter
@Setter
public static class Pool {
/**
* 连接池-最大数量
*/
private int maxIdleConnections = 5;
/**
* 连接池-保持时间间隔(秒)
*/
private long keepAliveDuration = 5L;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy