You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "mahaitao617 (via GitHub)" <gi...@apache.org> on 2023/02/01 02:46:50 UTC

[GitHub] [rocketmq] mahaitao617 commented on a diff in pull request #5895: [ISSUE #5896] feat:add pop consumer example

mahaitao617 commented on code in PR #5895:
URL: https://github.com/apache/rocketmq/pull/5895#discussion_r1092708249


##########
example/src/main/java/org/apache/rocketmq/example/simple/PushConsumer.java:
##########
@@ -16,32 +16,53 @@
  */
 package org.apache.rocketmq.example.simple;
 
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
 import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
 import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
 import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
-import org.apache.rocketmq.client.exception.MQClientException;
 import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
 import org.apache.rocketmq.common.message.MessageExt;
+import org.apache.rocketmq.common.message.MessageRequestMode;
+import org.apache.rocketmq.remoting.protocol.route.BrokerData;
+import org.apache.rocketmq.tools.admin.DefaultMQAdminExt;
 
 public class PushConsumer {
-
-    public static void main(String[] args) throws InterruptedException, MQClientException {
-        DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("CID_JODIE_1");
-        consumer.subscribe("TopicTest", "*");
+    public static final String DEFAULT_NAMESRVADDR = "127.0.0.1:9876";
+    public static final String TOPIC = "TopicTest";
+    public static final String CONSUMER_GROUP = "CID_JODIE_1";
+    public static void main(String[] args) throws Exception {
+        // switchPop();

Review Comment:
   i have solved it,pls review it again,ths



-- 
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-unsubscribe@rocketmq.apache.org

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