Search in sources :

Example 1 with TopicConfigInfo

use of org.apache.rocketmq.console.model.request.TopicConfigInfo in project rocketmq-externals by apache.

the class TopicServiceImpl method examineTopicConfig.

@Override
public List<TopicConfigInfo> examineTopicConfig(String topic) {
    List<TopicConfigInfo> topicConfigInfoList = Lists.newArrayList();
    TopicRouteData topicRouteData = route(topic);
    for (BrokerData brokerData : topicRouteData.getBrokerDatas()) {
        TopicConfigInfo topicConfigInfo = new TopicConfigInfo();
        TopicConfig topicConfig = examineTopicConfig(topic, brokerData.getBrokerName());
        BeanUtils.copyProperties(topicConfig, topicConfigInfo);
        topicConfigInfo.setBrokerNameList(Lists.newArrayList(brokerData.getBrokerName()));
        topicConfigInfoList.add(topicConfigInfo);
    }
    return topicConfigInfoList;
}
Also used : BrokerData(org.apache.rocketmq.common.protocol.route.BrokerData) TopicConfigInfo(org.apache.rocketmq.console.model.request.TopicConfigInfo) TopicConfig(org.apache.rocketmq.common.TopicConfig) TopicRouteData(org.apache.rocketmq.common.protocol.route.TopicRouteData)

Example 2 with TopicConfigInfo

use of org.apache.rocketmq.console.model.request.TopicConfigInfo in project rocketmq-externals by apache.

the class TopicServiceImplTest method createOrUpdate.

@Test
public void createOrUpdate() throws Exception {
    TopicConfigInfo topicConfigInfo = new TopicConfigInfo();
    topicConfigInfo.setBrokerNameList(Lists.newArrayList(TestConstant.TEST_BROKER_NAME));
    topicConfigInfo.setTopicName(TEST_CREATE_DELETE_TOPIC);
    topicService.createOrUpdate(topicConfigInfo);
    TopicList topicList = topicService.fetchAllTopicList();
    Assert.assertNotNull(topicList);
    Assert.assertTrue(CollectionUtils.isNotEmpty(topicList.getTopicList()));
    Assert.assertTrue(topicList.getTopicList().contains(TEST_CREATE_DELETE_TOPIC));
}
Also used : TopicConfigInfo(org.apache.rocketmq.console.model.request.TopicConfigInfo) TopicList(org.apache.rocketmq.common.protocol.body.TopicList) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 3 with TopicConfigInfo

use of org.apache.rocketmq.console.model.request.TopicConfigInfo in project rocketmq-externals by apache.

the class RocketMQConsoleTestBase method registerTestMQTopic.

protected void registerTestMQTopic() {
    TopicConfigInfo topicConfigInfo = new TopicConfigInfo();
    topicConfigInfo.setBrokerNameList(Lists.newArrayList(TestConstant.TEST_BROKER_NAME));
    topicConfigInfo.setTopicName(TEST_CONSOLE_TOPIC);
    topicConfigInfo.setWriteQueueNums(WRITE_QUEUE_NUM);
    topicConfigInfo.setReadQueueNums(READ_QUEUE_NUM);
    topicConfigInfo.setPerm(PERM);
    topicService.createOrUpdate(topicConfigInfo);
}
Also used : TopicConfigInfo(org.apache.rocketmq.console.model.request.TopicConfigInfo)

Aggregations

TopicConfigInfo (org.apache.rocketmq.console.model.request.TopicConfigInfo)3 TopicConfig (org.apache.rocketmq.common.TopicConfig)1 TopicList (org.apache.rocketmq.common.protocol.body.TopicList)1 BrokerData (org.apache.rocketmq.common.protocol.route.BrokerData)1 TopicRouteData (org.apache.rocketmq.common.protocol.route.TopicRouteData)1 Test (org.junit.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1