YonminMa commented on code in PR #6463:
URL: https://github.com/apache/rocketmq/pull/6463#discussion_r1147194001


##########
example/src/main/java/org/apache/rocketmq/example/simple/PushConsumer.java:
##########
@@ -26,10 +26,14 @@
 import org.apache.rocketmq.common.message.MessageExt;
 
 public class PushConsumer {
-
+    public static final String TOPIC = "TopicTest";
+    public static final String CONSUMER_GROUP = "CID_JODIE_1";
+    public static final String NAMESRV_ADDR = "127.0.0.1:9876";
     public static void main(String[] args) throws InterruptedException, 
MQClientException {
-        DefaultMQPushConsumer consumer = new 
DefaultMQPushConsumer("CID_JODIE_1");
-        consumer.subscribe("TopicTest", "*");
+
+        DefaultMQPushConsumer consumer = new 
DefaultMQPushConsumer(CONSUMER_GROUP);
+        consumer.setNamesrvAddr(NAMESRV_ADDR);

Review Comment:
   For most people who have just used RocketMQ, they just want to successfully 
run the PushConsumer, but they will get a "connect to null failed" message. In 
addition, namesrvAddr is also hard coded in PullConsumer, so I think hard 
coding namesrvAddr is helpful for novices who have just learned RocketMQ.



-- 
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