Java Code Examples for org.apache.rocketmq.test.util.MQRandomUtils#getRandomTopic()

The following examples show how to use org.apache.rocketmq.test.util.MQRandomUtils#getRandomTopic() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseConf.java    From rocketmq with Apache License 2.0 6 votes vote down vote up
public static String initTopic() {
    long startTime = System.currentTimeMillis();
    String topic = MQRandomUtils.getRandomTopic();
    boolean createResult = false;
    while (true) {
        createResult = MQAdmin.createTopic(nsAddr, clusterName, topic, 8);
        if (createResult) {
            break;
        } else if (System.currentTimeMillis() - startTime > topicCreateTime) {
            Assert.fail(String.format("topic[%s] is created failed after:%d ms", topic,
                System.currentTimeMillis() - startTime));
            break;
        } else {
            TestUtils.waitForMonment(500);
            continue;
        }
    }

    return topic;
}
 
Example 2
Source File: BaseConf.java    From rocketmq_trans_message with Apache License 2.0 6 votes vote down vote up
public static String initTopic() {
    long startTime = System.currentTimeMillis();
    String topic = MQRandomUtils.getRandomTopic();
    boolean createResult = false;
    while (true) {
        createResult = MQAdmin.createTopic(nsAddr, clusterName, topic, 8);
        if (createResult) {
            break;
        } else if (System.currentTimeMillis() - startTime > topicCreateTime) {
            Assert.fail(String.format("topic[%s] is created failed after:%d ms", topic,
                System.currentTimeMillis() - startTime));
            break;
        } else {
            TestUtils.waitForMonment(500);
            continue;
        }
    }

    return topic;
}
 
Example 3
Source File: BaseConf.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
public static String initTopic() {
    String topic = MQRandomUtils.getRandomTopic();
    IntegrationTestBase.initTopic(topic, nsAddr, clusterName);

    return topic;
}
 
Example 4
Source File: BaseConf.java    From rocketmq-4.3.0 with Apache License 2.0 4 votes vote down vote up
public static String initTopic() {
    String topic = MQRandomUtils.getRandomTopic();
    IntegrationTestBase.initTopic(topic, nsAddr, clusterName);

    return topic;
}
 
Example 5
Source File: BaseConf.java    From rocketmq-read with Apache License 2.0 4 votes vote down vote up
public static String initTopic() {
    String topic = MQRandomUtils.getRandomTopic();
    IntegrationTestBase.initTopic(topic, nsAddr, clusterName);

    return topic;
}
 
Example 6
Source File: BaseConf.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
public static String initTopic() {
    String topic = MQRandomUtils.getRandomTopic();
    IntegrationTestBase.initTopic(topic, nsAddr, clusterName);

    return topic;
}
 
Example 7
Source File: BaseConf.java    From rocketmq-all-4.1.0-incubating with Apache License 2.0 4 votes vote down vote up
public static String initTopic() {
    String topic = MQRandomUtils.getRandomTopic();
    IntegrationTestBase.initTopic(topic, nsAddr, clusterName);

    return topic;
}
 
Example 8
Source File: BaseConf.java    From rocketmq with Apache License 2.0 4 votes vote down vote up
public static String initTopic() {
    String topic = MQRandomUtils.getRandomTopic();
    IntegrationTestBase.initTopic(topic, nsAddr, clusterName);

    return topic;
}