[ISSUE #42]Fix deleteSubscriptionGroup not remove consumer offset. (#45)

Co-authored-by: zhangjidi2016 <zhangjidi@cmss.chinamobile.com>
This commit is contained in:
zhangjidi2016
2021-11-17 13:30:12 +08:00
committed by GitHub
parent a5a3659c04
commit e660c7d874
3 changed files with 6 additions and 3 deletions

View File

@@ -278,8 +278,9 @@ public class MQAdminExtImpl implements MQAdminExt {
}
@Override
public void deleteSubscriptionGroup(String addr, String groupName, boolean removeOffset) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
throw new UnsupportedOperationException();
public void deleteSubscriptionGroup(String addr, String groupName, boolean removeOffset)
throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
MQAdminInstance.threadLocalMQAdminExt().deleteSubscriptionGroup(addr, groupName, removeOffset);
}
@Override

View File

@@ -294,7 +294,7 @@ public class ConsumerServiceImpl extends AbstractCommonService implements Consum
ClusterInfo clusterInfo = mqAdminExt.examineBrokerClusterInfo();
for (String brokerName : deleteSubGroupRequest.getBrokerNameList()) {
logger.info("addr={} groupName={}", clusterInfo.getBrokerAddrTable().get(brokerName).selectBrokerAddr(), deleteSubGroupRequest.getGroupName());
mqAdminExt.deleteSubscriptionGroup(clusterInfo.getBrokerAddrTable().get(brokerName).selectBrokerAddr(), deleteSubGroupRequest.getGroupName());
mqAdminExt.deleteSubscriptionGroup(clusterInfo.getBrokerAddrTable().get(brokerName).selectBrokerAddr(), deleteSubGroupRequest.getGroupName(), true);
}
}
catch (Exception e) {

View File

@@ -418,8 +418,10 @@ public class MQAdminExtImplTest {
assertNotNull(mqAdminExtImpl);
{
doNothing().when(defaultMQAdminExt).deleteSubscriptionGroup(anyString(), anyString());
doNothing().when(defaultMQAdminExt).deleteSubscriptionGroup(anyString(), anyString(), anyBoolean());
}
mqAdminExtImpl.deleteSubscriptionGroup(brokerAddr, "group_test");
mqAdminExtImpl.deleteSubscriptionGroup(brokerAddr, "group_test", true);
}
@Test