疯狂的狮子li
2022-04-22 70c1a37bbd95bd3850d23c902fbe82aaf835adae
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
package com.ruoyi.framework.config.properties;
 
import lombok.Data;
import lombok.NoArgsConstructor;
import org.redisson.config.ReadMode;
import org.redisson.config.SubscriptionMode;
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 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;
 
        /**
         * 发布和订阅连接池大小
         */
        private int subscriptionConnectionPoolSize;
 
    }
 
    @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;
 
        /**
         * 命令等待超时,单位:毫秒
         */
        private int timeout;
 
        /**
         * 发布和订阅连接池大小
         */
        private int subscriptionConnectionPoolSize;
 
        /**
         * 读取模式
         */
        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;
 
    }
 
}