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 2021/12/17 07:09:51 UTC
[GitHub] [rocketmq] wz2cool opened a new issue #3660: need a way to delete consumer group
wz2cool opened a new issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660
version 4.8.0
For some business reasons, we need create consumer group by ip address dynamically. but we also need to delete consumer group if the application is down.
It seems that it doesn't work, I have deleted all consumer groups in rocketmq-console, but I still see them in topic. I find relatived issue about it #1799
--
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] panzhi33 commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
panzhi33 commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-996569264
> > somebody can fix it,you can see if it is what you want [apache/rocketmq-dashboard#45](https://github.com/apache/rocketmq-dashboard/pull/45)
>
> I'm afraid that it doesn't work . it seems that just delete offset, not delete relation of topic
The subscription relationship is maintained by the client,just delete the consumer offset
--
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] panzhi33 commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
panzhi33 commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997682349
queryTopicConsumeByWho This method checks the subscription relationship. If you want to delete the group, the consumer will stop.
After reading your demo, you deleted the consumer without stopping it. This is a non-standard operation. If you want to delete a group, it must be that the group is no longer in use.
--
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] wz2cool removed a comment on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool removed a comment on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997687931
> queryTopicConsumeByWho This method checks the subscription relationship. If you want to delete the group, the consumer will stop. After reading your demo, you deleted the consumer without stopping it. This is a non-standard operation. If you want to delete a group, it must be that the group is no longer in use.
yes, you are right , it works in rocketmq(4.9.2) will test in rocketmq(4.8.0) , thank you for your help
--
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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997687931
> queryTopicConsumeByWho This method checks the subscription relationship. If you want to delete the group, the consumer will stop. After reading your demo, you deleted the consumer without stopping it. This is a non-standard operation. If you want to delete a group, it must be that the group is no longer in use.
yes, you are right , it works in rocketmq(4.9.2) will test in rocketmq(4.8.0) , thank you for your help
--
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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997673647
> Need to upgrade to version 4.9 or above。 org.apache.rocketmq.broker.offset.ConsumerOffsetManager#removeOffset Version 4.8 does not have this method, and consumerOffset cannot be deleted
thank you for your response.
yes , i indeed test it by using 4.9.2, but queryTopicConsumeByWho contains deleted customer group
![image](https://user-images.githubusercontent.com/11556152/146730580-9b42b14f-0be9-4bbf-954b-03cedc668ea4.png)
--
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] panzhi33 commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
panzhi33 commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997546538
Need to upgrade to version 4.9 or above。
org.apache.rocketmq.broker.offset.ConsumerOffsetManager#removeOffset
Version 4.8 does not have this method, and consumerOffset cannot be deleted
--
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] wz2cool edited a comment on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool edited a comment on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997697275
> queryTopicConsumeByWho This method checks the subscription relationship. If you want to delete the group, the consumer will stop. After reading your demo, you deleted the consumer without stopping it. This is a non-standard operation. If you want to delete a group, it must be that the group is no longer in use.
yes you are right , your response make me clear ("no longer in use "), Everything seems ok if call DefaultMQPushConsumer#shutdown method.
But, if close the application without call DefaultMQPushConsumer#shutdown, it will keep the relation of topic even if I delete the customer group later
I need more tests to confirm 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] panzhi33 commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
panzhi33 commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-996547484
somebody can fix it,you can see if it is what you want
https://github.com/apache/rocketmq-dashboard/pull/45
--
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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997977314
after some tests , I have confirmed this issue has been resolved in rocketmq 4.9 .
this issue will happen when using rocketmq 4.8 even if using rocketmq-tool 4.9.2
@panzhi33 I found some related issues opened , could you help to close 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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997697275
> queryTopicConsumeByWho This method checks the subscription relationship. If you want to delete the group, the consumer will stop. After reading your demo, you deleted the consumer without stopping it. This is a non-standard operation. If you want to delete a group, it must be that the group is no longer in use.
yes you are right , your response make me clear ("no longer in use "), Everything seems ok if call DefaultMQPushConsumer#shutdown method.
But, if close the application without call DefaultMQPushConsumer#shutdown, it will keep the relation of topic
--
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] wz2cool removed a comment on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool removed a comment on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-996500672
find another issue about it #3094 need help
--
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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-996560854
> somebody can fix it,you can see if it is what you want [apache/rocketmq-dashboard#45](https://github.com/apache/rocketmq-dashboard/pull/45)
I'm afraid that it doesn't work . it seems that just delete offset, not delete relation of topic
--
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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997681613
Read the sourcecode of rocketmq-dashboard. it also call queryTopicConsumeByWho(topic) . it's why we can see deleted customer group in UI
![image](https://user-images.githubusercontent.com/11556152/146732344-c3791fcb-6537-40bf-bc0d-8d4f16fbe858.png)
--
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] wz2cool edited a comment on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool edited a comment on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997977314
after some tests , I have confirmed this issue has been resolved in rocketmq 4.9 .
this issue will happen when using rocketmq 4.8 even if i delete consumer group by rocketmq-tool 4.9.2.
@panzhi33 I found some related issues opened , could you help to close these issues?
--
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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-996500672
find another issue about it #3094 need help
--
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] wz2cool edited a comment on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool edited a comment on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997681613
Read the sourcecode of rocketmq-dashboard. it also call queryTopicConsumeByWho(topic) . it's why we can see deleted customer group in UI
![image](https://user-images.githubusercontent.com/11556152/146732487-388fd516-9744-4619-b539-7e3796ae53b4.png)
![image](https://user-images.githubusercontent.com/11556152/146732344-c3791fcb-6537-40bf-bc0d-8d4f16fbe858.png)
--
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] wz2cool edited a comment on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool edited a comment on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997697275
> queryTopicConsumeByWho This method checks the subscription relationship. If you want to delete the group, the consumer will stop. After reading your demo, you deleted the consumer without stopping it. This is a non-standard operation. If you want to delete a group, it must be that the group is no longer in use.
yes you are right , your response make me clear ("no longer in use "), Everything seems ok if call DefaultMQPushConsumer#shutdown method.
But, if close the application without call DefaultMQPushConsumer#shutdown, it will keep the relation of topic even if I delete the customer group
I need more tests to confirm 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] duhenglucky closed issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
duhenglucky closed issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660
--
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] wz2cool edited a comment on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool edited a comment on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997697275
> queryTopicConsumeByWho This method checks the subscription relationship. If you want to delete the group, the consumer will stop. After reading your demo, you deleted the consumer without stopping it. This is a non-standard operation. If you want to delete a group, it must be that the group is no longer in use.
yes you are right , your response make me clear ("no longer in use "), Everything seems ok if call DefaultMQPushConsumer#shutdown method.
But, if close the application without call DefaultMQPushConsumer#shutdown, it will keep the relation of topic even if I delete the customer group
--
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] wz2cool edited a comment on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool edited a comment on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-996612921
> > > somebody can fix it,you can see if it is what you want [apache/rocketmq-dashboard#45](https://github.com/apache/rocketmq-dashboard/pull/45)
> >
> >
> > I'm afraid that it doesn't work . it seems that just delete offset, not delete relation of topic
>
> The subscription relationship is maintained by the client,just delete the consumer offset
I think something wrong in server side.
it contains deleted consumer group even if I have deleted it
![image](https://user-images.githubusercontent.com/11556152/146531123-65cde306-a312-4c6c-b9ab-eab605fe1832.png)
--
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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-996612921
> > > somebody can fix it,you can see if it is what you want [apache/rocketmq-dashboard#45](https://github.com/apache/rocketmq-dashboard/pull/45)
> >
> >
> > I'm afraid that it doesn't work . it seems that just delete offset, not delete relation of topic
>
> The subscription relationship is maintained by the client,just delete the consumer offset
I think something wrong in server side.
![image](https://user-images.githubusercontent.com/11556152/146531123-65cde306-a312-4c6c-b9ab-eab605fe1832.png)
--
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] panzhi33 commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
panzhi33 commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-998403842
@duhenglucky
--
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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-996564058
here is code, I use
```
private void deleteSubscriptionGroup(String topic, String consumerGroup)
throws RemotingException, MQClientException, InterruptedException, MQBrokerException {
final TopicRouteData topicRouteData = this.mqAdmin.examineTopicRouteInfo(topic);
if (CollectionUtils.isEmpty(topicRouteData.getBrokerDatas())) {
return;
}
for (BrokerData brokerData : topicRouteData.getBrokerDatas()) {
for (Map.Entry<Long, String> entry : brokerData.getBrokerAddrs().entrySet()) {
String brokerAddr = entry.getValue();
this.mqAdmin.deleteSubscriptionGroup(brokerAddr, consumerGroup, true);
}
}
}
```
--
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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-996665021
i write a example to filter valid consumer group
```
private Set<String> listValidConsumerGroups(String topic)
throws RemotingException, MQClientException, InterruptedException, MQBrokerException {
final TopicRouteData topicRouteData = this.mqAdmin.examineTopicRouteInfo(topic);
if (CollectionUtils.isEmpty(topicRouteData.getBrokerDatas())) {
return new HashSet<>();
}
Set<String> validGroupSet = new HashSet<>();
for (BrokerData brokerData : topicRouteData.getBrokerDatas()) {
for (Map.Entry<Long, String> entry : brokerData.getBrokerAddrs().entrySet()) {
String brokerAddr = entry.getValue();
long timeoutMillis = TimeUnit.SECONDS.toMillis(1);
final SubscriptionGroupWrapper allSubscriptionGroup = this.mqAdmin.getAllSubscriptionGroup(brokerAddr, timeoutMillis);
ConcurrentMap<String, SubscriptionGroupConfig> subscriptionGroupTable = allSubscriptionGroup.getSubscriptionGroupTable();
validGroupSet.addAll(subscriptionGroupTable.keySet());
}
}
final GroupList consumeGroupList = this.mqAdmin.queryTopicConsumeByWho(topic);
// 删除消费组是无法删除topic 和消费组的关系的, 所以我们要和现在的组做一次交集运算
final HashSet<String> relationGroups = consumeGroupList.getGroupList();
validGroupSet.retainAll(relationGroups);
return validGroupSet;
}
```
![image](https://user-images.githubusercontent.com/11556152/146541023-25520de2-f816-47df-bd7c-38c9e518f4e4.png)
--
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] wz2cool commented on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool commented on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997676107
@panzhi33 I write a demo to show this problem
[rocketmq-consumer.zip](https://github.com/apache/rocketmq/files/7743392/rocketmq-consumer.zip)
--
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] wz2cool edited a comment on issue #3660: need a way to delete consumer group
Posted by GitBox <gi...@apache.org>.
wz2cool edited a comment on issue #3660:
URL: https://github.com/apache/rocketmq/issues/3660#issuecomment-997977314
after some tests , I have confirmed this issue has been resolved in rocketmq 4.9 .
this issue will happen when using rocketmq 4.8 even if i delete consumer group by rocketmq-tool 4.9.2.
@panzhi33 I found some related issues opened , could you help to close 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