buptxxb65 commented on code in PR #6417:
URL: https://github.com/apache/rocketmq/pull/6417#discussion_r1148414533
##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultLitePullConsumerImpl.java:
##########
@@ -1065,6 +1110,72 @@ private PullResult pullSyncImpl(MessageQueue mq,
SubscriptionData subscriptionDa
return pullResult;
}
+ private void pull(MessageQueue mq, SubscriptionData subscriptionData, long
offset, int maxNums, PullCallback pullCallback)
+ throws MQClientException, RemotingException, MQBrokerException,
InterruptedException {
+ this.pull(mq, subscriptionData, offset, maxNums,
this.defaultLitePullConsumer.getConsumerPullTimeoutMillis(), pullCallback);
+ }
+
+ private void pull(MessageQueue mq, SubscriptionData subscriptionData, long
offset, int maxNums, long timeout,
+ PullCallback pullCallback)
+ throws MQClientException, RemotingException, MQBrokerException,
InterruptedException {
+ this.pullAsyncImpl(mq, subscriptionData, offset, maxNums, true,
timeout, pullCallback);
+ }
+
+ private void pullAsyncImpl(MessageQueue mq, SubscriptionData
subscriptionData, long offset, int maxNums,
Review Comment:
Thanks for your comment! In fact, there are 11 lines of duplicated code in
pullSyncImpl() and pullAsyncImpl(). So we can extract a method for them.
However, I notice that in DefaultMQPullConsumer, these two functions are
written in the same way(duplicated code).
"I retain a little. I think retain some flavor of RocketMQ can let you know
you are reading RocketMQ's code." 🐶
--
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]