唐耀东
2021-12-09 eeeddf0836a5a5aa03a3342d34318c7202313e93
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
package com.ruoyi.framework.config.properties;
 
import lombok.Data;
import lombok.NoArgsConstructor;
import org.redisson.config.ReadMode;
import org.redisson.config.SubscriptionMode;
import org.redisson.config.TransportMode;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
import java.util.List;
 
/**
 * Redisson 配置属性
 *
 * @author Lion Li
 */
@Data
@Component
@ConfigurationProperties(prefix = "redisson")
public class RedissonProperties {
 
    /**
     * 线程池数量,默认值 = 当前处理核数量 * 2
     */
    private int threads;
 
    /**
     * Netty线程池数量,默认值 = 当前处理核数量 * 2
     */
    private int nettyThreads;
 
    /**
     * 传输模式
     */
    private TransportMode transportMode;
 
    /**
     * 单机服务配置
     */
    private SingleServerConfig singleServerConfig;
 
    /**
     * 集群服务配置
     */
    private ClusterServersConfig clusterServersConfig;
 
    /**
     * 缓存组
     */
    private List<CacheGroup> cacheGroup;
 
    @Data
    @NoArgsConstructor
    public static class SingleServerConfig {
 
        /**
         * 客户端名称
         */
        private String clientName;
 
        /**
         * 最小空闲连接数
         */
        private int connectionMinimumIdleSize;
 
        /**
         * 连接池大小
         */
        private int connectionPoolSize;
 
        /**
         * 连接空闲超时,单位:毫秒
         */
        private int idleConnectionTimeout;
 
        /**
         * 命令等待超时,单位:毫秒
         */
        private int timeout;
 
        /**
         * 如果尝试在此限制之内发送成功,则开始启用 timeout 计时。
         */
        private int retryAttempts;
 
        /**
         * 命令重试发送时间间隔,单位:毫秒
         */
        private int retryInterval;
 
        /**
         * 发布和订阅连接的最小空闲连接数
         */
        private int subscriptionConnectionMinimumIdleSize;
 
        /**
         * 发布和订阅连接池大小
         */
        private int subscriptionConnectionPoolSize;
 
        /**
         * 单个连接最大订阅数量
         */
        private int subscriptionsPerConnection;
 
        /**
         * DNS监测时间间隔,单位:毫秒
         */
        private int dnsMonitoringInterval;
 
    }
 
    @Data
    @NoArgsConstructor
    public static class ClusterServersConfig {
 
        /**
         * 客户端名称
         */
        private String clientName;
 
        /**
         * master最小空闲连接数
         */
        private int masterConnectionMinimumIdleSize;
 
        /**
         * master连接池大小
         */
        private int masterConnectionPoolSize;
 
        /**
         * slave最小空闲连接数
         */
        private int slaveConnectionMinimumIdleSize;
 
        /**
         * slave连接池大小
         */
        private int slaveConnectionPoolSize;
 
        /**
         * 连接空闲超时,单位:毫秒
         */
        private int idleConnectionTimeout;
 
        /**
         * ping超时
         */
        private int pingConnectionInterval;
 
        /**
         * 命令等待超时,单位:毫秒
         */
        private int timeout;
 
        /**
         * 如果尝试在此限制之内发送成功,则开始启用 timeout 计时。
         */
        private int retryAttempts;
 
        /**
         * 命令重试发送时间间隔,单位:毫秒
         */
        private int retryInterval;
 
        /**
         * 错误重试次数
         */
        private int failedSlaveReconnectionInterval;
 
        /**
         * 发布和订阅连接池最小空闲连接数
         */
        private int subscriptionConnectionMinimumIdleSize;
 
        /**
         * 发布和订阅连接池大小
         */
        private int subscriptionConnectionPoolSize;
 
        /**
         * 单个连接最大订阅数量
         */
        private int subscriptionsPerConnection;
 
        /**
         * 扫描间隔
         */
        private int scanInterval;
 
        /**
         * DNS监测时间间隔,单位:毫秒
         */
        private int dnsMonitoringInterval;
 
        /**
         * 读取模式
         */
        private ReadMode readMode;
 
        /**
         * 订阅模式
         */
        private SubscriptionMode subscriptionMode;
 
    }
 
    @Data
    @NoArgsConstructor
    public static class CacheGroup {
 
        /**
         * 组id
         */
        private String groupId;
 
        /**
         * 组过期时间
         */
        private long ttl;
 
        /**
         * 组最大空闲时间
         */
        private long maxIdleTime;
 
        /**
         * 组最大长度
         */
        private int maxSize;
 
    }
 
}