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


##########
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:
   Other than unit tests, I don't see anywhere to call it. The instance of 
Notifymanger cancelates the injection of ServiceConf, when is this ServiceConf 
passed in?



##########
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:
   Other than unit tests, I don't see anywhere to call it. The instance of 
Notifymanger cancelates the injection of ServiceConf, when is this ServiceConf 
passed in?



##########
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:
   Other than unit tests, I don't see anywhere to call it. The instance of 
Notifymanger cancelates the injection of ServiceConf, when is this ServiceConf 
passed in?



-- 
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: commits-unsubscr...@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to