qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject svn commit: r1769088 - in /qpid/java/trunk: client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java systests/src/test/java/org/apache/qpid/server/queue/ConsumerPriorityTest.java
Date Thu, 10 Nov 2016 11:22:54 GMT
Author: orudyy
Date: Thu Nov 10 11:22:54 2016
New Revision: 1769088

URL: http://svn.apache.org/viewvc?rev=1769088&view=rev
Log:
QPID-7505: Sync session after sending flow command to restore credits after credits reset
in result of execution of message.flush as part of BaseicMessageConsumer_0_10#receive()

Modified:
    qpid/java/trunk/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
    qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/ConsumerPriorityTest.java

Modified: qpid/java/trunk/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java?rev=1769088&r1=1769087&r2=1769088&view=diff
==============================================================================
--- qpid/java/trunk/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
(original)
+++ qpid/java/trunk/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
Thu Nov 10 11:22:54 2016
@@ -401,7 +401,6 @@ public class BasicMessageConsumer_0_10 e
            
             _0_10session.getQpidSession().messageFlush
                 (getConsumerTagString(), Option.UNRELIABLE, Option.SYNC);
-            _0_10session.getQpidSession().sync();
             _0_10session.getQpidSession().messageFlow
                 (getConsumerTagString(), MessageCreditUnit.BYTE,
                  0xFFFFFFFF, Option.UNRELIABLE);
@@ -414,6 +413,7 @@ public class BasicMessageConsumer_0_10 e
                                                 _capacity,
                                                 Option.UNRELIABLE);
             }
+            _0_10session.getQpidSession().sync();
             _0_10session.syncDispatchQueue(false);
             o = super.getMessageFromQueue(-1);
         }

Modified: qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/ConsumerPriorityTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/ConsumerPriorityTest.java?rev=1769088&r1=1769087&r2=1769088&view=diff
==============================================================================
--- qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/ConsumerPriorityTest.java
(original)
+++ qpid/java/trunk/systests/src/test/java/org/apache/qpid/server/queue/ConsumerPriorityTest.java
Thu Nov 10 11:22:54 2016
@@ -33,7 +33,6 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
-import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.jms.ConnectionURL;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 
@@ -89,9 +88,6 @@ public class ConsumerPriorityTest extend
         final MessageConsumer consumer = _consumingSession.createConsumer(queue);
         assertNull("There should be no messages in the queue", consumer.receive(100L));
 
-        // make sure that credit is restored on consumer after message.flush/flow being sent
from receive
-        ((AMQSession<?,?>)_consumingSession).sync();
-
         final Connection secondConsumingConnection = getConnection();
         final Session secondConsumingSession = secondConsumingConnection.createSession(false,
Session.CLIENT_ACKNOWLEDGE);
         secondConsumingConnection.start();
@@ -99,23 +95,14 @@ public class ConsumerPriorityTest extend
         final MessageConsumer standardPriorityConsumer = secondConsumingSession.createConsumer(secondConsumingSession.createQueue("direct://amq.direct/"
+ getTestQueueName() + "/" + getTestQueueName()));
         assertNull("There should be no messages in the queue", standardPriorityConsumer.receive(100L));
 
-        // make sure that credit is restored on consumer after message.flush/flow being sent
from receive
-        ((AMQSession<?,?>)secondConsumingSession).sync();
 
         Destination producerDestination = _producingSession.createQueue("direct://amq.direct/"
+ getTestQueueName() + "/" + getTestQueueName());
         final MessageProducer producer = _producingSession.createProducer(producerDestination);
         producer.send(_producingSession.createTextMessage(getTestName()));
         assertNull("Message should not go to the low priority consumer", consumer.receive(100L));
-
-        // make sure that credit is restored on consumer after message.flush/flow being sent
from receive
-        ((AMQSession<?,?>)_consumingSession).sync();
-
         producer.send(_producingSession.createTextMessage(getTestName() + " 2"));
         assertNull("Message should not go to the low priority consumer", consumer.receive(100L));
 
-        // make sure that credit is restored on consumer after message.flush/flow being sent
from receive
-        ((AMQSession<?,?>)_consumingSession).sync();
-
         assertNotNull(standardPriorityConsumer.receive(100L));
 
         assertNotNull(standardPriorityConsumer.receive(100L));



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message