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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]