Java Code Examples for org.apache.rocketmq.test.util.MQAdmin#createTopic()
The following examples show how to use
org.apache.rocketmq.test.util.MQAdmin#createTopic() .
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: IntegrationTestBase.java From DDMQ with Apache License 2.0 | 6 votes |
public static boolean initTopic(String topic, String nsAddr, String clusterName, int queueNumbers) { long startTime = System.currentTimeMillis(); boolean createResult; while (true) { createResult = MQAdmin.createTopic(nsAddr, clusterName, topic, queueNumbers); 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.waitForMoment(500); continue; } } return createResult; }
Example 2
Source File: IntegrationTestBase.java From rocketmq-4.3.0 with Apache License 2.0 | 6 votes |
public static boolean initTopic(String topic, String nsAddr, String clusterName, int queueNumbers) { long startTime = System.currentTimeMillis(); boolean createResult; while (true) { createResult = MQAdmin.createTopic(nsAddr, clusterName, topic, queueNumbers); 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.waitForMoment(500); continue; } } return createResult; }
Example 3
Source File: IntegrationTestBase.java From rocketmq-read with Apache License 2.0 | 6 votes |
public static boolean initTopic(String topic, String nsAddr, String clusterName, int queueNumbers) { long startTime = System.currentTimeMillis(); boolean createResult; while (true) { createResult = MQAdmin.createTopic(nsAddr, clusterName, topic, queueNumbers); 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.waitForMoment(500); continue; } } return createResult; }
Example 4
Source File: BaseConf.java From rocketmq with Apache License 2.0 | 6 votes |
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 5
Source File: IntegrationTestBase.java From DDMQ with Apache License 2.0 | 6 votes |
public static boolean initTopic(String topic, String nsAddr, String clusterName, int queueNumbers) { long startTime = System.currentTimeMillis(); boolean createResult; while (true) { createResult = MQAdmin.createTopic(nsAddr, clusterName, topic, queueNumbers); 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.waitForMoment(500); continue; } } return createResult; }
Example 6
Source File: IntegrationTestBase.java From rocketmq-all-4.1.0-incubating with Apache License 2.0 | 6 votes |
public static boolean initTopic(String topic, String nsAddr, String clusterName) { long startTime = System.currentTimeMillis(); boolean createResult; 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.waitForMoment(500); continue; } } return createResult; }
Example 7
Source File: BaseConf.java From rocketmq_trans_message with Apache License 2.0 | 6 votes |
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 8
Source File: IntegrationTestBase.java From rocketmq with Apache License 2.0 | 6 votes |
public static boolean initTopic(String topic, String nsAddr, String clusterName, int queueNumbers) { long startTime = System.currentTimeMillis(); boolean createResult; while (true) { createResult = MQAdmin.createTopic(nsAddr, clusterName, topic, queueNumbers); 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.waitForMoment(500); continue; } } return createResult; }