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


Java RMQDelayListner类代码示例

本文整理汇总了Java中org.apache.rocketmq.test.listener.rmq.concurrent.RMQDelayListner的典型用法代码示例。如果您正苦于以下问题:Java RMQDelayListner类的具体用法?Java RMQDelayListner怎么用?Java RMQDelayListner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RMQDelayListner类属于org.apache.rocketmq.test.listener.rmq.concurrent包,在下文中一共展示了RMQDelayListner类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.apache.rocketmq.test.listener.rmq.concurrent.RMQDelayListner; //导入依赖的package包/类
@Before
public void setUp() {
    topic = initTopic();
    logger.info(String.format("use topic: %s;", topic));
    producer = getProducer(nsAddr, topic);
    consumer = getConsumer(nsAddr, topic, "*", new RMQDelayListner());
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:8,代码来源:NormalMsgDelayIT.java

示例2: testDelayLevell

import org.apache.rocketmq.test.listener.rmq.concurrent.RMQDelayListner; //导入依赖的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

示例3: testDelayLevel2

import org.apache.rocketmq.test.listener.rmq.concurrent.RMQDelayListner; //导入依赖的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

示例4: testDelayLevel3

import org.apache.rocketmq.test.listener.rmq.concurrent.RMQDelayListner; //导入依赖的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

示例5: testDelayLevel4

import org.apache.rocketmq.test.listener.rmq.concurrent.RMQDelayListner; //导入依赖的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

示例6: testDelayLevell

import org.apache.rocketmq.test.listener.rmq.concurrent.RMQDelayListner; //导入依赖的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

示例7: testDelayLevel2

import org.apache.rocketmq.test.listener.rmq.concurrent.RMQDelayListner; //导入依赖的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

示例8: testDelayLevel3

import org.apache.rocketmq.test.listener.rmq.concurrent.RMQDelayListner; //导入依赖的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

示例9: testDelayLevel4

import org.apache.rocketmq.test.listener.rmq.concurrent.RMQDelayListner; //导入依赖的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.listener.rmq.concurrent.RMQDelayListner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。