Java Code Examples for org.apache.rocketmq.test.factory.MQMessageFactory#getDelayMsg()
The following examples show how to use
org.apache.rocketmq.test.factory.MQMessageFactory#getDelayMsg() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NormalMsgDelayIT.java From rocketmq-read with Apache License 2.0 | 5 votes |
@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())); }
Example 2
Source File: NormalMsgDelayIT.java From rocketmq with Apache License 2.0 | 5 votes |
@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())); }
Example 3
Source File: NormalMsgDelayIT.java From DDMQ with Apache License 2.0 | 5 votes |
@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())); }
Example 4
Source File: NormalMsgDelayIT.java From DDMQ with Apache License 2.0 | 5 votes |
@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())); }
Example 5
Source File: NormalMsgDelayIT.java From DDMQ with Apache License 2.0 | 5 votes |
@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())); }
Example 6
Source File: NormalMsgDelayIT.java From rocketmq-all-4.1.0-incubating with Apache License 2.0 | 5 votes |
@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())); }
Example 7
Source File: NormalMsgDelayIT.java From rocketmq with Apache License 2.0 | 5 votes |
@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())); }
Example 8
Source File: NormalMsgDelayIT.java From rocketmq_trans_message with Apache License 2.0 | 5 votes |
@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())); }
Example 9
Source File: NormalMsgDelayIT.java From rocketmq with Apache License 2.0 | 5 votes |
@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())); }
Example 10
Source File: NormalMsgDelayIT.java From rocketmq-read with Apache License 2.0 | 5 votes |
@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())); }
Example 11
Source File: NormalMsgDelayIT.java From DDMQ with Apache License 2.0 | 5 votes |
@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())); }
Example 12
Source File: NormalMsgDelayIT.java From rocketmq-read with Apache License 2.0 | 5 votes |
@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())); }
Example 13
Source File: NormalMsgDelayIT.java From rocketmq-read with Apache License 2.0 | 5 votes |
@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())); }
Example 14
Source File: NormalMsgDelayIT.java From rocketmq-4.3.0 with Apache License 2.0 | 5 votes |
@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())); }
Example 15
Source File: NormalMsgDelayIT.java From rocketmq-all-4.1.0-incubating with Apache License 2.0 | 5 votes |
@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())); }
Example 16
Source File: NormalMsgDelayIT.java From rocketmq-4.3.0 with Apache License 2.0 | 5 votes |
@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())); }
Example 17
Source File: NormalMsgDelayIT.java From rocketmq with Apache License 2.0 | 5 votes |
@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())); }
Example 18
Source File: NormalMsgDelayIT.java From DDMQ with Apache License 2.0 | 5 votes |
@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())); }
Example 19
Source File: NormalMsgDelayIT.java From DDMQ with Apache License 2.0 | 5 votes |
@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())); }
Example 20
Source File: NormalMsgDelayIT.java From rocketmq with Apache License 2.0 | 5 votes |
@Test public void testDelayLevel1() throws Exception { Thread.sleep(3000); 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())); }