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/05/19 02:40:05 UTC

[GitHub] [rocketmq] sighting33 opened a new issue, #4342: how to get all group infos?

sighting33 opened a new issue, #4342:
URL: https://github.com/apache/rocketmq/issues/4342

   1.consumer group
   2.product group
   
   Is there any api about group Info?


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

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


[GitHub] [rocketmq] yangjava commented on issue #4342: how to get all group infos?

Posted by GitBox <gi...@apache.org>.
yangjava commented on issue #4342:
URL: https://github.com/apache/rocketmq/issues/4342#issuecomment-1131780174

   public class MQClientInstance {
       private final static long LOCK_TIMEOUT_MILLIS = 3000;
       private final InternalLogger log = ClientLogger.getLog();
       private final ClientConfig clientConfig;
       private final int instanceIndex;
       private final String clientId;
       private final long bootTimestamp = System.currentTimeMillis();
       private final ConcurrentMap<String/* group */, MQProducerInner> producerTable = new ConcurrentHashMap<String, MQProducerInner>();
       private final ConcurrentMap<String/* group */, MQConsumerInner> consumerTable = new ConcurrentHashMap<String, MQConsumerInner>();
       private final ConcurrentMap<String/* group */, MQAdminExtInner> adminExtTable = new ConcurrentHashMap<String, MQAdminExtInner>();


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


[GitHub] [rocketmq] yangjava commented on issue #4342: how to get all group infos?

Posted by GitBox <gi...@apache.org>.
yangjava commented on issue #4342:
URL: https://github.com/apache/rocketmq/issues/4342#issuecomment-1131781413

   public class MQClientInstance {
       .....
       private final ConcurrentMap<String/* group */, MQProducerInner> producerTable = new ConcurrentHashMap<String, MQProducerInner>();
       private final ConcurrentMap<String/* group */, MQConsumerInner> consumerTable = new ConcurrentHashMap<String, MQConsumerInner>();
       private final ConcurrentMap<String/* group */, MQAdminExtInner> adminExtTable = new ConcurrentHashMap<String, MQAdminExtInner>();      


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


[GitHub] [rocketmq] yangjava commented on issue #4342: how to get all group infos?

Posted by GitBox <gi...@apache.org>.
yangjava commented on issue #4342:
URL: https://github.com/apache/rocketmq/issues/4342#issuecomment-1131787230

   public class MQClientInstance {
      ...
       private final ConcurrentMap<String/* group */, MQProducerInner> producerTable = new ConcurrentHashMap<String, MQProducerInner>();
       private final ConcurrentMap<String/* group */, MQConsumerInner> consumerTable = new ConcurrentHashMap<String, MQConsumerInner>();
       private final ConcurrentMap<String/* group */, MQAdminExtInner> adminExtTable = new ConcurrentHashMap<String, MQAdminExtInner>();       
       add set get                                                                                                                                                                    


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


[GitHub] [rocketmq] cserwen closed issue #4342: how to get all group infos?

Posted by GitBox <gi...@apache.org>.
cserwen closed issue #4342: how to get all group infos?
URL: https://github.com/apache/rocketmq/issues/4342


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


[GitHub] [rocketmq] yangjava commented on issue #4342: how to get all group infos?

Posted by GitBox <gi...@apache.org>.
yangjava commented on issue #4342:
URL: https://github.com/apache/rocketmq/issues/4342#issuecomment-1131362414

   in rocketmq dashboard
   
   1.consumer group
   
   
   `   @Override
       public List<GroupConsumeInfo> queryGroupList(boolean skipSysGroup) {
           Set<String> consumerGroupSet = Sets.newHashSet();
           try {
               ClusterInfo clusterInfo = mqAdminExt.examineBrokerClusterInfo();
               for (BrokerData brokerData : clusterInfo.getBrokerAddrTable().values()) {
                   SubscriptionGroupWrapper subscriptionGroupWrapper = mqAdminExt.getAllSubscriptionGroup(brokerData.selectBrokerAddr(), 3000L);
                   consumerGroupSet.addAll(subscriptionGroupWrapper.getSubscriptionGroupTable().keySet());
               }
           }
           catch (Exception err) {
               throw Throwables.propagate(err);
           }
           List<GroupConsumeInfo> groupConsumeInfoList = Lists.newArrayList();
           for (String consumerGroup : consumerGroupSet) {
               groupConsumeInfoList.add(queryGroup(consumerGroup));
           }
           if (!skipSysGroup) {
               groupConsumeInfoList.stream().map(group -> {
                   if (SYSTEM_GROUP_SET.contains(group.getGroup())) {
                       group.setGroup(String.format("%s%s", "%SYS%", group.getGroup()));
                   }
                   return group;
               }).collect(Collectors.toList());
           }
           Collections.sort(groupConsumeInfoList);
           return groupConsumeInfoList;
       }`


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


[GitHub] [rocketmq] cserwen commented on issue #4342: how to get all group infos?

Posted by GitBox <gi...@apache.org>.
cserwen commented on issue #4342:
URL: https://github.com/apache/rocketmq/issues/4342#issuecomment-1134382091

   > we dont use dashboard. use rocketmq client only .
   
   @sighting33 You can refer to `getAllSubscriptionGroup` of `DefaultMQAdminExt` to get All groups.
   https://github.com/apache/rocketmq/blob/82a48be00a6d9def14abb871a40cb68cf8a041e9/tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExt.java#L504
   
   In fact, some access to metadata can be achieved through DefaultMQAdminExt. RocketMQ Dashboard is implemented using it.
   
   
   


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


[GitHub] [rocketmq] sighting33 commented on issue #4342: how to get all group infos?

Posted by GitBox <gi...@apache.org>.
sighting33 commented on issue #4342:
URL: https://github.com/apache/rocketmq/issues/4342#issuecomment-1131619133

   > 
   we dont use dashboard. use rocketmq client only .


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