Tabnine Logo
RMQSqlConsumer.getListener
Code IndexAdd Tabnine to your IDE (free)

How to use
getListener
method
in
org.apache.rocketmq.test.client.rmq.RMQSqlConsumer

Best Java code snippets using org.apache.rocketmq.test.client.rmq.RMQSqlConsumer.getListener (Showing top 2 results out of 315)

origin: apache/rocketmq

@Test
public void testFilterConsumer() throws Exception {
  int msgSize = 16;
  String group = initConsumerGroup();
  MessageSelector selector = MessageSelector.bySql("(TAGS is not null and TAGS in ('TagA', 'TagB'))");
  RMQSqlConsumer consumer = ConsumerFactory.getRMQSqlConsumer(nsAddr, group, topic, selector, new RMQNormalListener(group + "_1"));
  Thread.sleep(3000);
  producer.send("TagA", msgSize);
  producer.send("TagB", msgSize);
  producer.send("TagC", msgSize);
  Assert.assertEquals("Not all sent succeeded", msgSize * 3, producer.getAllUndupMsgBody().size());
  consumer.getListener().waitForMessageConsume(msgSize * 2, consumeTime);
  assertThat(producer.getAllMsgBody())
    .containsAllIn(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
      consumer.getListener().getAllMsgBody()));
  assertThat(consumer.getListener().getAllMsgBody().size()).isEqualTo(msgSize * 2);
}
origin: didi/DDMQ

  @Test
  public void testFilterConsumer() throws Exception {
    int msgSize = 16;

    String group = initConsumerGroup();
    MessageSelector selector = MessageSelector.bySql("(TAGS is not null and TAGS in ('TagA', 'TagB'))");
    RMQSqlConsumer consumer = ConsumerFactory.getRMQSqlConsumer(nsAddr, group, topic, selector, new RMQNormalListener(group + "_1"));
    Thread.sleep(3000);
    producer.send("TagA", msgSize);
    producer.send("TagB", msgSize);
    producer.send("TagC", msgSize);
    Assert.assertEquals("Not all sent succeeded", msgSize * 3, producer.getAllUndupMsgBody().size());
    consumer.getListener().waitForMessageConsume(msgSize * 2, consumeTime);
    assertThat(producer.getAllMsgBody())
      .containsAllIn(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(),
        consumer.getListener().getAllMsgBody()));

    assertThat(consumer.getListener().getAllMsgBody().size()).isEqualTo(msgSize * 2);
  }
}
org.apache.rocketmq.test.client.rmqRMQSqlConsumergetListener

Popular methods of RMQSqlConsumer

  • <init>
  • create
  • start

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • getResourceAsStream (ClassLoader)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now