use of org.apache.rocketmq.console.model.request.ConsumerConfigInfo in project rocketmq-externals by apache.
the class ConsumerServiceImpl method examineSubscriptionGroupConfig.
@Override
@MultiMQAdminCmdMethod
public List<ConsumerConfigInfo> examineSubscriptionGroupConfig(String group) {
List<ConsumerConfigInfo> consumerConfigInfoList = Lists.newArrayList();
try {
ClusterInfo clusterInfo = mqAdminExt.examineBrokerClusterInfo();
for (String brokerName : clusterInfo.getBrokerAddrTable().keySet()) {
// foreach brokerName
String brokerAddress = clusterInfo.getBrokerAddrTable().get(brokerName).selectBrokerAddr();
SubscriptionGroupConfig subscriptionGroupConfig = mqAdminExt.examineSubscriptionGroupConfig(brokerAddress, group);
if (subscriptionGroupConfig == null) {
continue;
}
consumerConfigInfoList.add(new ConsumerConfigInfo(Lists.newArrayList(brokerName), subscriptionGroupConfig));
}
} catch (Exception e) {
throw propagate(e);
}
return consumerConfigInfoList;
}
use of org.apache.rocketmq.console.model.request.ConsumerConfigInfo in project rocketmq-externals by apache.
the class ConsumerServiceImplTest method createAndUpdateSubscriptionGroupConfig.
@Test
public void createAndUpdateSubscriptionGroupConfig() throws Exception {
ConsumerConfigInfo consumerConfigInfoForCreate = new ConsumerConfigInfo();
BeanUtils.copyProperties(consumerConfigInfo, consumerConfigInfoForCreate);
consumerConfigInfoForCreate.getSubscriptionGroupConfig().setGroupName(TEST_CREATE_DELETE_CONSUMER_GROUP);
Assert.assertTrue(consumerService.createAndUpdateSubscriptionGroupConfig(consumerConfigInfoForCreate));
Assert.assertTrue(CollectionUtils.isNotEmpty(consumerService.examineSubscriptionGroupConfig(TEST_CREATE_DELETE_CONSUMER_GROUP)));
}
use of org.apache.rocketmq.console.model.request.ConsumerConfigInfo in project rocketmq-externals by apache.
the class ConsumerServiceImplTest method deleteSubGroup.
@Test
public void deleteSubGroup() throws Exception {
createAndUpdateSubscriptionGroupConfig();
DeleteSubGroupRequest deleteSubGroupRequest = new DeleteSubGroupRequest();
deleteSubGroupRequest.setBrokerNameList(Lists.<String>newArrayList(TestConstant.TEST_BROKER_NAME));
deleteSubGroupRequest.setGroupName(TEST_CREATE_DELETE_CONSUMER_GROUP);
Assert.assertTrue(consumerService.deleteSubGroup(deleteSubGroupRequest));
List<ConsumerConfigInfo> groupConsumeInfoList = consumerService.examineSubscriptionGroupConfig(TEST_CREATE_DELETE_CONSUMER_GROUP);
Assert.assertTrue(CollectionUtils.isEmpty(groupConsumeInfoList));
}
Aggregations