本文整理汇总了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()));
}