use of org.apache.rocketmq.test.listener.rmq.concurrent.RMQNormalListner in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class TagMessageWith1ConsumerIT method testSubAllMessageWithNullTag.
@Test
public void testSubAllMessageWithNullTag() {
String tag = null;
String subExpress = "*";
int msgSize = 10;
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress, new RMQNormalListner());
producer.send(tag, msgSize);
Assert.assertEquals("Not all are sent", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(), consumer.getListner().getAllMsgBody())).containsExactlyElementsIn(producer.getAllMsgBody());
}
use of org.apache.rocketmq.test.listener.rmq.concurrent.RMQNormalListner in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class TagMessageWith1ConsumerIT method testSubAllMessageWithTag.
@Test
public void testSubAllMessageWithTag() {
String tag = "jueyin";
String subExpress = "*";
int msgSize = 10;
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress, new RMQNormalListner());
producer.send(tag, msgSize);
Assert.assertEquals("Not all are sent", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(), consumer.getListner().getAllMsgBody())).containsExactlyElementsIn(producer.getAllMsgBody());
}
use of org.apache.rocketmq.test.listener.rmq.concurrent.RMQNormalListner in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class TagMessageWith1ConsumerIT method testSubNullWithTagNull.
@Test
public void testSubNullWithTagNull() {
String tag = null;
String subExpress = null;
int msgSize = 10;
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress, new RMQNormalListner());
producer.send(tag, msgSize);
Assert.assertEquals("Not all are sent", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(), consumer.getListner().getAllMsgBody())).containsExactlyElementsIn(producer.getAllMsgBody());
}
use of org.apache.rocketmq.test.listener.rmq.concurrent.RMQNormalListner in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class TagMessageWith1ConsumerIT method testSubAllMessageNoTag.
@Test
public void testSubAllMessageNoTag() {
String subExprress = "*";
int msgSize = 10;
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExprress, new RMQNormalListner());
producer.send(msgSize);
Assert.assertEquals("Not all are sent", msgSize, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(), consumer.getListner().getAllMsgBody())).containsExactlyElementsIn(producer.getAllMsgBody());
}
use of org.apache.rocketmq.test.listener.rmq.concurrent.RMQNormalListner in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class TagMessageWith1ConsumerIT method testSubAllWithKindsOfMessage.
@Test
public void testSubAllWithKindsOfMessage() {
String tag1 = null;
String tag2 = "jueyin";
String subExpress = "*";
int msgSize = 10;
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress, new RMQNormalListner());
List<Object> tag1Msgs = MQMessageFactory.getRMQMessage(tag1, topic, msgSize);
List<Object> tag2Msgs = MQMessageFactory.getRMQMessage(tag2, topic, msgSize);
producer.send(tag1Msgs);
producer.send(tag2Msgs);
producer.send(10);
Assert.assertEquals("Not all are sent", msgSize * 3, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(), consumer.getListner().getAllMsgBody())).containsExactlyElementsIn(producer.getAllMsgBody());
}
Aggregations