本文整理匯總了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());
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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()));
}
示例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()));
}