本文整理汇总了Java中org.apache.rocketmq.test.factory.MQMessageFactory.getRMQMessage方法的典型用法代码示例。如果您正苦于以下问题:Java MQMessageFactory.getRMQMessage方法的具体用法?Java MQMessageFactory.getRMQMessage怎么用?Java MQMessageFactory.getRMQMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.rocketmq.test.factory.MQMessageFactory
的用法示例。
在下文中一共展示了MQMessageFactory.getRMQMessage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSubTwoTabAndMatchOne
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testSubTwoTabAndMatchOne() {
String tag1 = "jueyin1";
String tag2 = "jueyin2";
String subExpress = String.format("%s||noExistTag", tag2);
int msgSize = 10;
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress,
new RMQNormalListner());
producer.send(tag1, msgSize);
Assert.assertEquals("Not all sent succeeded", msgSize, producer.getAllUndupMsgBody().size());
List<Object> tag2Msgs = MQMessageFactory.getRMQMessage(tag2, topic, msgSize);
producer.send(tag2Msgs);
Assert.assertEquals("Not all sent succeeded", msgSize * 2, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(MQMessageFactory.getMessageBody(tag2Msgs),
consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumer.getListner().getAllMsgBody()))
.containsExactlyElementsIn(MQMessageFactory.getMessageBody(tag2Msgs));
}
示例2: testSubAllWithKindsOfMessage
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@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());
}
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:23,代码来源:TagMessageWith1ConsumerIT.java
示例3: testSubNullWithKindsOfMessage
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testSubNullWithKindsOfMessage() {
String tag1 = null;
String tag2 = "jueyin";
String subExpress = null;
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);
Assert.assertEquals("Not all are sent", msgSize * 2, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumer.getListner().getAllMsgBody()))
.containsExactlyElementsIn(producer.getAllMsgBody());
}
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:22,代码来源:TagMessageWith1ConsumerIT.java
示例4: testSubTagWithKindsOfMessage
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testSubTagWithKindsOfMessage() {
String tag1 = null;
String tag2 = "jueyin";
String subExpress = tag2;
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(MQMessageFactory.getMessageBody(tag2Msgs),
consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumer.getListner().getAllMsgBody()))
.containsExactlyElementsIn(MQMessageFactory.getMessageBody(tag2Msgs));
}
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:24,代码来源:TagMessageWith1ConsumerIT.java
示例5: testSubTwoTabAndMatchOne
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testSubTwoTabAndMatchOne() {
String tag1 = "jueyin1";
String tag2 = "jueyin2";
String subExpress = String.format("%s||noExistTag", tag2);
int msgSize = 10;
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress,
new RMQNormalListener());
producer.send(tag1, msgSize);
Assert.assertEquals("Not all sent succeeded", msgSize, producer.getAllUndupMsgBody().size());
List<Object> tag2Msgs = MQMessageFactory.getRMQMessage(tag2, topic, msgSize);
producer.send(tag2Msgs);
Assert.assertEquals("Not all sent succeeded", msgSize * 2, producer.getAllUndupMsgBody().size());
consumer.getListener().waitForMessageConsume(MQMessageFactory.getMessageBody(tag2Msgs),
consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumer.getListener().getAllMsgBody()))
.containsExactlyElementsIn(MQMessageFactory.getMessageBody(tag2Msgs));
}
示例6: testSubAllWithKindsOfMessage
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testSubAllWithKindsOfMessage() {
String tag1 = null;
String tag2 = "jueyin";
String subExpress = "*";
int msgSize = 10;
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress,
new RMQNormalListener());
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.getListener().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumer.getListener().getAllMsgBody()))
.containsExactlyElementsIn(producer.getAllMsgBody());
}
示例7: testSubNullWithKindsOfMessage
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testSubNullWithKindsOfMessage() {
String tag1 = null;
String tag2 = "jueyin";
String subExpress = null;
int msgSize = 10;
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress,
new RMQNormalListener());
List<Object> tag1Msgs = MQMessageFactory.getRMQMessage(tag1, topic, msgSize);
List<Object> tag2Msgs = MQMessageFactory.getRMQMessage(tag2, topic, msgSize);
producer.send(tag1Msgs);
producer.send(tag2Msgs);
Assert.assertEquals("Not all are sent", msgSize * 2, producer.getAllUndupMsgBody().size());
consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumer.getListener().getAllMsgBody()))
.containsExactlyElementsIn(producer.getAllMsgBody());
}
示例8: testSubTagWithKindsOfMessage
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testSubTagWithKindsOfMessage() {
String tag1 = null;
String tag2 = "jueyin";
String subExpress = tag2;
int msgSize = 10;
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress,
new RMQNormalListener());
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.getListener().waitForMessageConsume(MQMessageFactory.getMessageBody(tag2Msgs),
consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumer.getListener().getAllMsgBody()))
.containsExactlyElementsIn(MQMessageFactory.getMessageBody(tag2Msgs));
}
示例9: testSendTwoTag
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testSendTwoTag() {
String tag1 = "jueyin1";
String tag2 = "jueyin2";
int msgSize = 10;
RMQNormalConsumer consumerTag1 = getConsumer(nsAddr, topic, tag1,
new RMQNormalListner());
RMQNormalConsumer consumerTag2 = getConsumer(nsAddr, topic, tag2,
new RMQNormalListner());
List<Object> tag1Msgs = MQMessageFactory.getRMQMessage(tag1, topic, msgSize);
producer.send(tag1Msgs);
Assert.assertEquals("Not all are sent", msgSize, producer.getAllUndupMsgBody().size());
List<Object> tag2Msgs = MQMessageFactory.getRMQMessage(tag2, topic, msgSize);
producer.send(tag2Msgs);
Assert.assertEquals("Not all are sent", msgSize * 2, producer.getAllUndupMsgBody().size());
consumerTag1.getListner().waitForMessageConsume(MQMessageFactory.getMessageBody(tag1Msgs),
consumeTime);
consumerTag2.getListner().waitForMessageConsume(MQMessageFactory.getMessageBody(tag2Msgs),
consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumerTag1.getListner().getAllMsgBody()))
.containsExactlyElementsIn(MQMessageFactory.getMessageBody(tag1Msgs));
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumerTag2.getListner().getAllMsgBody()))
.containsExactlyElementsIn(MQMessageFactory.getMessageBody(tag2Msgs));
}
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:30,代码来源:TagMessageWithMulConsumerIT.java
示例10: testSendTwoTag
import org.apache.rocketmq.test.factory.MQMessageFactory; //导入方法依赖的package包/类
@Test
public void testSendTwoTag() {
String tag1 = "jueyin1";
String tag2 = "jueyin2";
int msgSize = 10;
RMQNormalConsumer consumerTag1 = getConsumer(nsAddr, topic, tag1,
new RMQNormalListener());
RMQNormalConsumer consumerTag2 = getConsumer(nsAddr, topic, tag2,
new RMQNormalListener());
List<Object> tag1Msgs = MQMessageFactory.getRMQMessage(tag1, topic, msgSize);
producer.send(tag1Msgs);
Assert.assertEquals("Not all are sent", msgSize, producer.getAllUndupMsgBody().size());
List<Object> tag2Msgs = MQMessageFactory.getRMQMessage(tag2, topic, msgSize);
producer.send(tag2Msgs);
Assert.assertEquals("Not all are sent", msgSize * 2, producer.getAllUndupMsgBody().size());
consumerTag1.getListener().waitForMessageConsume(MQMessageFactory.getMessageBody(tag1Msgs),
consumeTime);
consumerTag2.getListener().waitForMessageConsume(MQMessageFactory.getMessageBody(tag2Msgs),
consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumerTag1.getListener().getAllMsgBody()))
.containsExactlyElementsIn(MQMessageFactory.getMessageBody(tag1Msgs));
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
consumerTag2.getListener().getAllMsgBody()))
.containsExactlyElementsIn(MQMessageFactory.getMessageBody(tag2Msgs));
}