Github user gaohoward commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/581#discussion_r67630013
  
    --- Diff: 
tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ZeroPrefetchConsumerTest.java
 ---
    @@ -157,9 +157,9 @@ public void testTwoConsumers() throws Exception {
           // now lets receive it
           MessageConsumer consumer1 = session.createConsumer(queue);
           MessageConsumer consumer2 = session.createConsumer(queue);
    -      TextMessage answer = (TextMessage) consumer1.receiveNoWait();
    +      TextMessage answer = (TextMessage) consumer1.receive(5000);
           assertEquals("Should have received a message!", answer.getText(), 
"Msg1");
    -      answer = (TextMessage) consumer2.receiveNoWait();
    +      answer = (TextMessage) consumer2.receive(5000);
    --- End diff --
    
    @clebertsuconic yes something is async. If you following session.commit() 
at server, it's async, which means after commit you can't expect the message is 
already at client side. You have to give it some time to allow messages to be 
delivered to the client. Using receiveNoWait() is not proper here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to