You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/08/28 10:43:26 UTC

[GitHub] [rocketmq-schema-registry] MatrixHB commented on a diff in pull request #52: [ISSUE #48] Support different consumer group by ip

MatrixHB commented on code in PR #52:
URL: https://github.com/apache/rocketmq-schema-registry/pull/52#discussion_r956706460


##########
storage-rocketmq/src/main/java/org/apache/rocketmq/schema/registry/storage/rocketmq/RocketmqClient.java:
##########
@@ -203,39 +200,28 @@ public void startRemoteStorage() {
         try {
             producer.start();
 
-            scheduleConsumer.setPullThreadNums(4);
+            scheduleConsumer.subscribe(storageTopic, "*");
+            scheduleConsumer.registerMessageListener(new MessageListener());
             scheduleConsumer.start();
-
-            Collection<MessageQueue> messageQueueList = scheduleConsumer.fetchMessageQueues(storageTopic);
-            scheduleConsumer.assign(messageQueueList);
-            messageQueueList.forEach(mq -> {
-                try {
-                    scheduleConsumer.seekToBegin(mq);
-                } catch (MQClientException e) {
-                    e.printStackTrace();
-                }
-            });
-            this.scheduledExecutorService.scheduleAtFixedRate(new RocketmqStoragePullTask(),
-                0, PULL_TASK_INTERVAL, TimeUnit.MILLISECONDS);
-
         } catch (MQClientException e) {
             throw new SchemaException("Rocketmq client start failed", e);
         }
     }
 
-    public class RocketmqStoragePullTask implements Runnable {
+    public class MessageListener implements MessageListenerConcurrently {
 

Review Comment:
   It's better to use MessageListenerOrderly instead of MessageListenerConcurrently



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

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