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 2020/12/21 11:45:31 UTC

[GitHub] [rocketmq] vongosling commented on a change in pull request #2504: [doc error fix] issue #2503

vongosling commented on a change in pull request #2504:
URL: https://github.com/apache/rocketmq/pull/2504#discussion_r546661563



##########
File path: tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java
##########
@@ -1051,4 +1054,29 @@ public boolean resumeCheckHalfMessage(final String topic, final String msgId) th
             return this.mqClientInstance.getMQClientAPIImpl().resumeCheckHalfMessage(RemotingUtil.socketAddress2String(msg.getStoreHost()), msgClient.getOffsetMsgId(), timeoutMillis);
         }
     }
+
+    /**
+     * check the consumer group instance use java or not
+     * for now, only one scenario can judged right: all instances in the group use the same language
+     * if >= 2 languages used in group instances, it will return false
+     *
+     * good news is for common ways, the coder would use one language for the group
+     * @param group consumer group name
+     * @return true: all is java instances, false: not sure
+     */
+    public boolean isAllInstancesInGroupJava(String group) throws InterruptedException, RemotingException, MQClientException, MQBrokerException {
+        ConsumerConnection connection =  this.examineConsumerConnectionInfo(group);
+        if (connection.getConnectionSet().isEmpty()) {
+            return false;
+        }
+        boolean isJava = false;
+        for (Connection con : connection.getConnectionSet()) {
+            if (LanguageCode.JAVA == con.getLanguage()) {
+                //if >=2 languages used in instances, it can't be judged

Review comment:
       @ShannonDing Would you like to help update some logic only works well for java? 




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

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