本文整理汇总了Java中org.apache.rocketmq.test.factory.MQMessageFactory.getDelayMsg方法的典型用法代码示例。如果您正苦于以下问题:Java MQMessageFactory.getDelayMsg方法的具体用法?Java MQMessageFactory.getDelayMsg怎么用?Java MQMessageFactory.getDelayMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.rocketmq.test.factory.MQMessageFactory
的用法示例。
在下文中一共展示了MQMessageFactory.getDelayMsg方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDelayLevell
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testDelayLevell() {
int delayLevel = 1;
List<Object> delayMsgs = MQMessageFactory.getDelayMsg(topic, delayLevel, msgSize);
producer.send(delayMsgs);
Assert.assertEquals("Not all sent succeeded", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
Assert.assertEquals("Not all are consumed", 0, VerifyUtils.verify(producer.getAllMsgBody(),
consumer.getListner().getAllMsgBody()));
Assert.assertEquals("Timer is not correct", true,
VerifyUtils.verifyDelay(DELAY_LEVEL[delayLevel - 1] * 1000,
((RMQDelayListner) consumer.getListner()).getMsgDelayTimes()));
}
示例2: testDelayLevel2
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testDelayLevel2() {
int delayLevel = 2;
List<Object> delayMsgs = MQMessageFactory.getDelayMsg(topic, delayLevel, msgSize);
producer.send(delayMsgs);
Assert.assertEquals("Not all sent succeeded", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(),
DELAY_LEVEL[delayLevel - 1] * 1000 * 2);
Assert.assertEquals("Not all are consumed", 0, VerifyUtils.verify(producer.getAllMsgBody(),
consumer.getListner().getAllMsgBody()));
Assert.assertEquals("Timer is not correct", true,
VerifyUtils.verifyDelay(DELAY_LEVEL[delayLevel - 1] * 1000,
((RMQDelayListner) consumer.getListner()).getMsgDelayTimes()));
}
示例3: testDelayLevel3
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testDelayLevel3() {
int delayLevel = 3;
List<Object> delayMsgs = MQMessageFactory.getDelayMsg(topic, delayLevel, msgSize);
producer.send(delayMsgs);
Assert.assertEquals("Not all are sent", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(),
DELAY_LEVEL[delayLevel - 1] * 1000 * 2);
Assert.assertEquals("Not all are consumed", 0, VerifyUtils.verify(producer.getAllMsgBody(),
consumer.getListner().getAllMsgBody()));
Assert.assertEquals("Timer is not correct", true,
VerifyUtils.verifyDelay(DELAY_LEVEL[delayLevel - 1] * 1000,
((RMQDelayListner) consumer.getListner()).getMsgDelayTimes()));
}
示例4: testDelayLevel4
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testDelayLevel4() {
int delayLevel = 4;
List<Object> delayMsgs = MQMessageFactory.getDelayMsg(topic, delayLevel, msgSize);
producer.send(delayMsgs);
Assert.assertEquals("Not all are sent", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(),
DELAY_LEVEL[delayLevel - 1] * 1000 * 2);
Assert.assertEquals("Not all are consumed", 0, VerifyUtils.verify(producer.getAllMsgBody(),
consumer.getListner().getAllMsgBody()));
Assert.assertEquals("Timer is not correct", true,
VerifyUtils.verifyDelay(DELAY_LEVEL[delayLevel - 1] * 1000,
((RMQDelayListner) consumer.getListner()).getMsgDelayTimes()));
}
示例5: testDelayLevell
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testDelayLevell() {
int delayLevel = 1;
List<Object> delayMsgs = MQMessageFactory.getDelayMsg(topic, delayLevel, msgSize);
producer.send(delayMsgs);
Assert.assertEquals("Not all sent succeeded", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
Assert.assertEquals("Not all are consumed", 0, VerifyUtils.verify(producer.getAllMsgBody(),
consumer.getListener().getAllMsgBody()));
Assert.assertEquals("Timer is not correct", true,
VerifyUtils.verifyDelay(DELAY_LEVEL[delayLevel - 1] * 1000,
((RMQDelayListner) consumer.getListener()).getMsgDelayTimes()));
}
示例6: testDelayLevel2
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testDelayLevel2() {
int delayLevel = 2;
List<Object> delayMsgs = MQMessageFactory.getDelayMsg(topic, delayLevel, msgSize);
producer.send(delayMsgs);
Assert.assertEquals("Not all sent succeeded", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(),
DELAY_LEVEL[delayLevel - 1] * 1000 * 2);
Assert.assertEquals("Not all are consumed", 0, VerifyUtils.verify(producer.getAllMsgBody(),
consumer.getListener().getAllMsgBody()));
Assert.assertEquals("Timer is not correct", true,
VerifyUtils.verifyDelay(DELAY_LEVEL[delayLevel - 1] * 1000,
((RMQDelayListner) consumer.getListener()).getMsgDelayTimes()));
}
示例7: testDelayLevel3
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testDelayLevel3() {
int delayLevel = 3;
List<Object> delayMsgs = MQMessageFactory.getDelayMsg(topic, delayLevel, msgSize);
producer.send(delayMsgs);
Assert.assertEquals("Not all are sent", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(),
DELAY_LEVEL[delayLevel - 1] * 1000 * 2);
Assert.assertEquals("Not all are consumed", 0, VerifyUtils.verify(producer.getAllMsgBody(),
consumer.getListener().getAllMsgBody()));
Assert.assertEquals("Timer is not correct", true,
VerifyUtils.verifyDelay(DELAY_LEVEL[delayLevel - 1] * 1000,
((RMQDelayListner) consumer.getListener()).getMsgDelayTimes()));
}
示例8: testDelayLevel4
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testDelayLevel4() {
int delayLevel = 4;
List<Object> delayMsgs = MQMessageFactory.getDelayMsg(topic, delayLevel, msgSize);
producer.send(delayMsgs);
Assert.assertEquals("Not all are sent", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(),
DELAY_LEVEL[delayLevel - 1] * 1000 * 2);
Assert.assertEquals("Not all are consumed", 0, VerifyUtils.verify(producer.getAllMsgBody(),
consumer.getListener().getAllMsgBody()));
Assert.assertEquals("Timer is not correct", true,
VerifyUtils.verifyDelay(DELAY_LEVEL[delayLevel - 1] * 1000,
((RMQDelayListner) consumer.getListener()).getMsgDelayTimes()));
}