shikeyin
2024-01-11 65da8373531677b1c37a98f53eaa30c892f35e5a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package com.iplatform.base.config;
 
import org.springframework.boot.context.properties.ConfigurationProperties;
 
@ConfigurationProperties(prefix = "iplatform.rest")
public class RestTemplateProperties {
 
    /**
     * 连接保持活动的时间,默认600秒
     * @return
     */
    public long getKeepAliveDurationSeconds() {
        return keepAliveDurationSeconds;
    }
 
    public void setKeepAliveDurationSeconds(long keepAliveDurationSeconds) {
        this.keepAliveDurationSeconds = keepAliveDurationSeconds;
    }
 
    /**
     * 最大空闲连接数量,默认:200
     * @return
     */
    public long getMaxIdleConnections() {
        return maxIdleConnections;
    }
 
    public void setMaxIdleConnections(long maxIdleConnections) {
        this.maxIdleConnections = maxIdleConnections;
    }
 
    /**
     * 连接超时,默认:2秒
     * @return
     */
    public long getConnectTimeoutSeconds() {
        return connectTimeoutSeconds;
    }
 
    public void setConnectTimeoutSeconds(long connectTimeoutSeconds) {
        this.connectTimeoutSeconds = connectTimeoutSeconds;
    }
 
    /**
     * 读超时,默认:3秒
     * @return
     */
    public long getReadTimeoutSeconds() {
        return readTimeoutSeconds;
    }
 
    public void setReadTimeoutSeconds(long readTimeoutSeconds) {
        this.readTimeoutSeconds = readTimeoutSeconds;
    }
 
    /**
     * 写超时,默认:3秒
     * @return
     */
    public long getWriteTimeoutSeconds() {
        return writeTimeoutSeconds;
    }
 
    public void setWriteTimeoutSeconds(long writeTimeoutSeconds) {
        this.writeTimeoutSeconds = writeTimeoutSeconds;
    }
 
    private long keepAliveDurationSeconds = 300;
    private long maxIdleConnections = 200;
    private long connectTimeoutSeconds = 2;
    private long readTimeoutSeconds = 3;
    private long writeTimeoutSeconds = 3;
}