You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/04/01 04:48:07 UTC

activemq-artemis git commit: Fixing MessagePull (prefetch cases)

Repository: activemq-artemis
Updated Branches:
  refs/heads/refactor-openwire 3b9dc7a63 -> bc942d1a9


Fixing MessagePull (prefetch cases)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/bc942d1a
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/bc942d1a
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/bc942d1a

Branch: refs/heads/refactor-openwire
Commit: bc942d1a94065ae9cd8b6530a65a42b452e7b798
Parents: 3b9dc7a
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Mar 31 22:47:55 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Mar 31 22:47:55 2016 -0400

----------------------------------------------------------------------
 .../artemis/core/protocol/openwire/OpenWireConnection.java         | 1 +
 .../activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java   | 2 +-
 .../test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java   | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bc942d1a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index f1eb8c6..754c2a3 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -1027,6 +1027,7 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
                if (consumer != null) {
                   System.out.println("Returning reference " + ref.getMessage());
                   referenceIterator.remove();
+                  ref.incrementDeliveryCount();
                   consumer.backToDelivering(ref);
                }
             }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bc942d1a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
index e65dbb8..7a06c73 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
@@ -278,7 +278,7 @@ public class AMQConsumer {
    }
 
    public void processMessagePull(MessagePull messagePull) throws Exception {
-      //      windowAvailable.incrementAndGet();
+      currentWindow.incrementAndGet();
       if (messagePullHandler != null) {
          messagePullHandler.nextSequence(messagePullSequence++, messagePull.getTimeout());
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bc942d1a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java
index 8a64a85..c57845d 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java
@@ -116,7 +116,7 @@ public class JmsRollbackRedeliveryTest {
             Session session = connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
             Destination destination = session.createQueue(destinationName);
             MessageConsumer consumer = session.createConsumer(destination);
-            TextMessage msg = (TextMessage) consumer.receive(6000000);
+            TextMessage msg = (TextMessage) consumer.receive(5000);
             if (msg != null) {
                if (rolledback.put(msg.getText(), Boolean.TRUE) != null) {
                   LOG.info("Received message " + msg.getText() + " (" + received.getAndIncrement() + ")" + msg.getJMSMessageID());