lizhanhui commented on code in PR #6463:
URL: https://github.com/apache/rocketmq/pull/6463#discussion_r1147051458
##########
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:
It's an example program and users may prefer to fill name server address
through an environment variable or java options...hardcoding one may not be
helpful
--
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]