@@ -57,30 +57,37 @@ public class MQCenter implements ApplicationRunner, ApplicationContextAware, Dis
57
57
*/
58
58
private Set <FastMQDelayListener > fastMQListeners2 ;
59
59
60
-
61
60
/**
62
61
* redissonClient对象
63
62
*/
64
- @ Autowired
65
- private RedissonClient client ;
63
+ private final RedissonClient client ;
66
64
67
65
/**
68
66
* fastmq配置属性
69
67
*/
70
- @ Autowired
71
- private FastMQProperties fastMQProperties ;
68
+ private final FastMQProperties fastMQProperties ;
72
69
73
70
/**
74
71
* 领域服务对象-异步
75
72
*/
76
- @ Autowired
77
- private FastMQAsyncService fastMQAsyncService ;
73
+ private final FastMQAsyncService fastMQAsyncService ;
78
74
79
75
/**
80
76
* 领域服务对象-同步
81
77
*/
78
+ private final FastMQService fastMQService ;
79
+
80
+
82
81
@ Autowired
83
- private FastMQService fastMQService ;
82
+ public MQCenter (RedissonClient client , FastMQProperties fastMQProperties , FastMQAsyncService fastMQAsyncService , FastMQService fastMQService ) {
83
+ this .client = client ;
84
+ this .fastMQProperties = fastMQProperties ;
85
+ this .fastMQAsyncService = fastMQAsyncService ;
86
+ this .fastMQService = fastMQService ;
87
+ fastMQListeners0 = new HashSet <>();
88
+ fastMQListeners1 = new HashSet <>();
89
+ fastMQListeners2 = new HashSet <>();
90
+ }
84
91
85
92
/**
86
93
* spring上下文对象,用于获取fastmq的bean实例
@@ -111,15 +118,6 @@ public class MQCenter implements ApplicationRunner, ApplicationContextAware, Dis
111
118
luaStr = sb .toString ();
112
119
}
113
120
114
- /**
115
- * Instantiates a new Mq center.
116
- */
117
- public MQCenter () {
118
- fastMQListeners0 = new HashSet <>();
119
- fastMQListeners1 = new HashSet <>();
120
- fastMQListeners2 = new HashSet <>();
121
- }
122
-
123
121
124
122
private void initThreadPool () {
125
123
service = Executors .newScheduledThreadPool (
0 commit comments