当前位置: 首页>>代码示例>>Java>>正文


Java MessageQueueMsg类代码示例

本文整理汇总了Java中org.apache.rocketmq.test.message.MessageQueueMsg的典型用法代码示例。如果您正苦于以下问题:Java MessageQueueMsg类的具体用法?Java MessageQueueMsg怎么用?Java MessageQueueMsg使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MessageQueueMsg类属于org.apache.rocketmq.test.message包,在下文中一共展示了MessageQueueMsg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testOrderMsg

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testOrderMsg() {
    int msgSize = 10;
    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListner().getAllMsgBody()))
        .containsExactlyElementsIn(mqMsgs.getMsgBodys());

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer.getListner()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:17,代码来源:OrderMsgIT.java

示例2: testSendOneQueue

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testSendOneQueue() {
    int msgSize = 20;
    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(MQMessageFactory.getMessageQueues(mqs.get(0)),
        msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListner().getAllMsgBody()))
        .containsExactlyElementsIn(mqMsgs.getMsgBodys());

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer.getListner()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:18,代码来源:OrderMsgIT.java

示例3: testSendRandomQueues

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testSendRandomQueues() {
    int msgSize = 10;
    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(
        MQMessageFactory.getMessageQueues(mqs.get(0), mqs.get(1), mqs.get(mqs.size() - 1)),
        msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListner().getAllMsgBody()))
        .containsExactlyElementsIn(mqMsgs.getMsgBodys());

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer.getListner()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:19,代码来源:OrderMsgIT.java

示例4: testOrderMsgWithTagSubAll

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testOrderMsgWithTagSubAll() {
    int msgSize = 10;
    String tag = "jueyin_tag";
    RMQNormalConsumer consumer = getConsumer(nsAddr, topic, "*", new RMQOrderListener());

    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize, tag);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListner().getAllMsgBody()))
        .containsExactlyElementsIn(mqMsgs.getMsgBodys());

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer.getListner()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:20,代码来源:OrderMsgWithTagIT.java

示例5: testOrderMsgWithTagSubTag

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testOrderMsgWithTagSubTag() {
    int msgSize = 5;
    String tag = "jueyin_tag";
    RMQNormalConsumer consumer = getConsumer(nsAddr, topic, tag, new RMQOrderListener());

    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize, tag);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListner().getAllMsgBody()))
        .containsExactlyElementsIn(mqMsgs.getMsgBodys());

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer.getListner()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:20,代码来源:OrderMsgWithTagIT.java

示例6: testTwoConsumerSubTag

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testTwoConsumerSubTag() {
    int msgSize = 10;

    RMQBroadCastConsumer consumer1 = getBroadCastConsumer(nsAddr, topic, "*",
        new RMQOrderListener());
    RMQBroadCastConsumer consumer2 = getBroadCastConsumer(nsAddr,
        consumer1.getConsumerGroup(), topic, "*", new RMQOrderListener());
    TestUtils.waitForSeconds(waitTime);

    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer1.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
    consumer2.getListner().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer1.getListner()).getMsgs()))
        .isEqualTo(true);
    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer2.getListner()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:23,代码来源:OrderMsgBroadCastIT.java

示例7: testOrderMsg

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testOrderMsg() {
    int msgSize = 10;
    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListener().getAllMsgBody()))
        .containsExactlyElementsIn(mqMsgs.getMsgBodys());

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer.getListener()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:17,代码来源:OrderMsgIT.java

示例8: testSendOneQueue

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testSendOneQueue() {
    int msgSize = 20;
    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(MQMessageFactory.getMessageQueues(mqs.get(0)),
        msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListener().getAllMsgBody()))
        .containsExactlyElementsIn(mqMsgs.getMsgBodys());

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer.getListener()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:18,代码来源:OrderMsgIT.java

示例9: testSendRandomQueues

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testSendRandomQueues() {
    int msgSize = 10;
    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(
        MQMessageFactory.getMessageQueues(mqs.get(0), mqs.get(1), mqs.get(mqs.size() - 1)),
        msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListener().getAllMsgBody()))
        .containsExactlyElementsIn(mqMsgs.getMsgBodys());

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer.getListener()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:19,代码来源:OrderMsgIT.java

示例10: testOrderMsgWithTagSubAll

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testOrderMsgWithTagSubAll() {
    int msgSize = 10;
    String tag = "jueyin_tag";
    RMQNormalConsumer consumer = getConsumer(nsAddr, topic, "*", new RMQOrderListener());

    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize, tag);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListener().getAllMsgBody()))
        .containsExactlyElementsIn(mqMsgs.getMsgBodys());

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer.getListener()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:20,代码来源:OrderMsgWithTagIT.java

示例11: testOrderMsgWithTagSubTag

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testOrderMsgWithTagSubTag() {
    int msgSize = 5;
    String tag = "jueyin_tag";
    RMQNormalConsumer consumer = getConsumer(nsAddr, topic, tag, new RMQOrderListener());

    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize, tag);
    producer.send(mqMsgs.getMsgsWithMQ());

    consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);

    assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListener().getAllMsgBody()))
        .containsExactlyElementsIn(mqMsgs.getMsgBodys());

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer.getListener()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:20,代码来源:OrderMsgWithTagIT.java

示例12: testTwoConsumerSubTag

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testTwoConsumerSubTag() {
    int msgSize = 10;

    RMQBroadCastConsumer consumer1 = getBroadCastConsumer(nsAddr, topic, "*",
        new RMQOrderListener());
    RMQBroadCastConsumer consumer2 = getBroadCastConsumer(nsAddr,
        consumer1.getConsumerGroup(), topic, "*", new RMQOrderListener());
    TestUtils.waitForSeconds(waitTime);

    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());
    consumer1.getListener().waitForMessageConsume(producer.getAllMsgBody(), broadcastConsumeTime);
    consumer2.getListener().waitForMessageConsume(producer.getAllMsgBody(), broadcastConsumeTime);

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer1.getListener()).getMsgs()))
        .isEqualTo(true);
    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer2.getListener()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:22,代码来源:OrderMsgBroadCastIT.java

示例13: testTwoConsumersBalance

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testTwoConsumersBalance() {
    int msgSize = 10;
    RMQNormalConsumer consumer1 = getConsumer(nsAddr, topic, "*", new RMQOrderListener());
    RMQNormalConsumer consumer2 = getConsumer(nsAddr, consumer1.getConsumerGroup(), topic,
        "*", new RMQOrderListener());
    TestUtils.waitForSeconds(waitTime);

    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());

    boolean recvAll = MQWait.waitConsumeAll(consumeTime, producer.getAllMsgBody(),
        consumer1.getListner(), consumer2.getListner());
    assertThat(recvAll).isEqualTo(true);

    boolean balance = VerifyUtils.verifyBalance(producer.getAllMsgBody().size(),
        VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
            consumer1.getListner().getAllUndupMsgBody()).size(),
        VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
            consumer2.getListner().getAllUndupMsgBody()).size());
    assertThat(balance).isEqualTo(true);

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer1.getListner()).getMsgs()))
        .isEqualTo(true);
    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer2.getListner()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:29,代码来源:OrderMsgRebalanceIT.java

示例14: testTwoConsumersBalance

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testTwoConsumersBalance() {
    int msgSize = 10;
    RMQNormalConsumer consumer1 = getConsumer(nsAddr, topic, "*", new RMQOrderListener());
    RMQNormalConsumer consumer2 = getConsumer(nsAddr, consumer1.getConsumerGroup(), topic,
        "*", new RMQOrderListener());
    TestUtils.waitForSeconds(waitTime);

    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());

    boolean recvAll = MQWait.waitConsumeAll(consumeTime, producer.getAllMsgBody(),
        consumer1.getListener(), consumer2.getListener());
    assertThat(recvAll).isEqualTo(true);

    boolean balance = VerifyUtils.verifyBalance(producer.getAllMsgBody().size(),
        VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
            consumer1.getListener().getAllUndupMsgBody()).size(),
        VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
            consumer2.getListener().getAllUndupMsgBody()).size());
    assertThat(balance).isEqualTo(true);

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer1.getListener()).getMsgs()))
        .isEqualTo(true);
    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer2.getListener()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:apache,项目名称:rocketmq,代码行数:29,代码来源:OrderMsgRebalanceIT.java

示例15: testFourConsuemrBalance

import org.apache.rocketmq.test.message.MessageQueueMsg; //导入依赖的package包/类
@Test
public void testFourConsuemrBalance() {
    int msgSize = 20;
    RMQNormalConsumer consumer1 = getConsumer(nsAddr, topic, "*", new RMQOrderListener());
    RMQNormalConsumer consumer2 = getConsumer(nsAddr, consumer1.getConsumerGroup(), topic,
        "*", new RMQOrderListener());
    RMQNormalConsumer consumer3 = getConsumer(nsAddr, consumer1.getConsumerGroup(), topic,
        "*", new RMQOrderListener());
    RMQNormalConsumer consumer4 = getConsumer(nsAddr, consumer1.getConsumerGroup(), topic,
        "*", new RMQOrderListener());
    TestUtils.waitForSeconds(waitTime);

    List<MessageQueue> mqs = producer.getMessageQueue();
    MessageQueueMsg mqMsgs = new MessageQueueMsg(mqs, msgSize);
    producer.send(mqMsgs.getMsgsWithMQ());

    boolean recvAll = MQWait.waitConsumeAll(consumeTime, producer.getAllMsgBody(),
        consumer1.getListner(), consumer2.getListner(), consumer3.getListner(),
        consumer4.getListner());
    assertThat(recvAll).isEqualTo(true);

    boolean balance = VerifyUtils
        .verifyBalance(producer.getAllMsgBody().size(),
            VerifyUtils
                .getFilterdMessage(producer.getAllMsgBody(),
                    consumer1.getListner().getAllUndupMsgBody())
                .size(),
            VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
                consumer2.getListner().getAllUndupMsgBody()).size(),
            VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
                consumer3.getListner().getAllUndupMsgBody()).size(),
            VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
                consumer4.getListner().getAllUndupMsgBody()).size());
    logger.info(String.format("consumer1:%s;consumer2:%s;consumer3:%s,consumer4:%s",
        consumer1.getListner().getAllMsgBody().size(),
        consumer2.getListner().getAllMsgBody().size(),
        consumer3.getListner().getAllMsgBody().size(),
        consumer4.getListner().getAllMsgBody().size()));
    assertThat(balance).isEqualTo(true);

    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer1.getListner()).getMsgs()))
        .isEqualTo(true);
    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer2.getListner()).getMsgs()))
        .isEqualTo(true);
    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer3.getListner()).getMsgs()))
        .isEqualTo(true);
    assertThat(VerifyUtils.verifyOrder(((RMQOrderListener) consumer4.getListner()).getMsgs()))
        .isEqualTo(true);
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:50,代码来源:OrderMsgRebalanceIT.java


注:本文中的org.apache.rocketmq.test.message.MessageQueueMsg类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。