shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
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
package com.walker.web;
 
public class RestTemplateConfig {
 
    public int getMaxIdleConnections() {
        return maxIdleConnections;
    }
 
    public void setMaxIdleConnections(int maxIdleConnections) {
        this.maxIdleConnections = maxIdleConnections;
    }
 
    public long getKeepAliveDurationSeconds() {
        return keepAliveDurationSeconds;
    }
 
    public void setKeepAliveDurationSeconds(long keepAliveDurationSeconds) {
        this.keepAliveDurationSeconds = keepAliveDurationSeconds;
    }
 
    public long getConnectTimeoutSeconds() {
        return connectTimeoutSeconds;
    }
 
    public void setConnectTimeoutSeconds(long connectTimeoutSeconds) {
        this.connectTimeoutSeconds = connectTimeoutSeconds;
    }
 
    public long getReadTimeoutSeconds() {
        return readTimeoutSeconds;
    }
 
    public void setReadTimeoutSeconds(long readTimeoutSeconds) {
        this.readTimeoutSeconds = readTimeoutSeconds;
    }
 
    public long getWriteTimeoutSeconds() {
        return writeTimeoutSeconds;
    }
 
    public void setWriteTimeoutSeconds(long writeTimeoutSeconds) {
        this.writeTimeoutSeconds = writeTimeoutSeconds;
    }
 
    // 连接池中整体的空闲连接的最大数量
    private int maxIdleConnections = 100;
    // 连接空闲时间最多为 300 秒
    private long keepAliveDurationSeconds = 300;
    // 连接超时(秒)
    private long connectTimeoutSeconds = 3;
    // 读超时(秒)
    private long readTimeoutSeconds = 3;
    // 写超时(秒)
    private long writeTimeoutSeconds = 3;
}