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/24 02:21:08 UTC

[GitHub] [rocketmq] odbozhou commented on a diff in pull request #4820: [ISSUE #4805]In the subscribe mode, user-defined MessageQueueListener is supported. At the same time, you can specify the offset that the MessageQueue will commit

odbozhou commented on code in PR #4820:
URL: https://github.com/apache/rocketmq/pull/4820#discussion_r953259885


##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultLitePullConsumerImpl.java:
##########
@@ -474,6 +478,41 @@ private void updateTopicSubscribeInfoWhenSubscriptionChanged() {
         }
     }
 
+    /**
+     * subscribe data by customizing messageQueueListener
+     * @param topic
+     * @param subExpression
+     * @param messageQueueListener
+     * @throws MQClientException
+     */
+    public synchronized void subscribe(String topic, String subExpression, MessageQueueListener messageQueueListener) throws MQClientException {
+        try {
+            if (topic == null || "".equals(topic)) {

Review Comment:
   StringUtils tool  judges empty and white space better



-- 
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