當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。