当前位置: 首页>>代码示例>>Java>>正文


Java MQMessageFactory.getDelayMsg方法代码示例

本文整理汇总了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()));
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:15,代码来源:NormalMsgDelayIT.java

示例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()));
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:16,代码来源:NormalMsgDelayIT.java

示例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()));
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:16,代码来源:NormalMsgDelayIT.java

示例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()));
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:16,代码来源:NormalMsgDelayIT.java

示例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()));
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:15,代码来源:NormalMsgDelayIT.java

示例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()));
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:16,代码来源:NormalMsgDelayIT.java

示例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()));
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:16,代码来源:NormalMsgDelayIT.java

示例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()));
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:16,代码来源:NormalMsgDelayIT.java


注:本文中的org.apache.rocketmq.test.factory.MQMessageFactory.getDelayMsg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。