YxAc commented on code in PR #276:
URL: https://github.com/apache/rocketmq-mqtt/pull/276#discussion_r1609572391


##########
mqtt-ds/src/main/java/org/apache/rocketmq/mqtt/ds/notify/NotifyManager.java:
##########
@@ -73,18 +72,20 @@ public class NotifyManager {
     private NettyRemotingClient remotingClient;
     private DefaultMQProducer defaultMQProducer;
 
-
-    @Resource
-    private ServiceConf serviceConf;
+    private final ServiceConf serviceConf;
 
     @Resource
     private MetaPersistManager metaPersistManager;
 
     @Resource
     private FirstTopicManager firstTopicManager;
 
-    @PostConstruct
-    public void init() throws MQClientException {
+    public NotifyManager(ServiceConf serviceConf) {
+        this.serviceConf = serviceConf;

Review Comment:
   +1, i think the constructor func is not necessary. @yx9o you can use `Mock` 
and `FieldUtils.writeDeclaredField` in unit test, for example, refer to 
`TestServiceConfListener.java`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to