qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject [1/5] qpid-jms git commit: Clear the message acknowledge handler past ack so that no pathological ack cycles can flood the session
Date Thu, 15 Jan 2015 22:56:31 GMT
Repository: qpid-jms
Updated Branches:
  refs/heads/master 1a986c68c -> 44eda7db2


Clear the message acknowledge handler past ack so that no pathological
ack cycles can flood the session 

Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/0474b3a3
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/0474b3a3
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/0474b3a3

Branch: refs/heads/master
Commit: 0474b3a37344964162d753cb3f6ce9db435b766a
Parents: 1a986c6
Author: Timothy Bish <tabish121@gmail.com>
Authored: Thu Jan 15 14:58:32 2015 -0500
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Thu Jan 15 14:58:32 2015 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/0474b3a3/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
index bce5b44..4f20b31 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
@@ -262,6 +262,7 @@ public class JmsMessageConsumer implements MessageConsumer, JmsMessageAvailableC
             } else {
                 doAckConsumed(envelope);
             }
+
             // Tags that we have delivered and can't close if in a TX Session.
             delivered.set(true);
         }
@@ -317,6 +318,7 @@ public class JmsMessageConsumer implements MessageConsumer, JmsMessageAvailableC
                             throw new javax.jms.IllegalStateException("Session closed.");
                         }
                         session.acknowledge();
+                        envelope.getMessage().setAcknowledgeCallback(null);
                         return null;
                     }
                 });
@@ -548,7 +550,7 @@ public class JmsMessageConsumer implements MessageConsumer, JmsMessageAvailableC
             while (session.isStarted() && (envelope = messageQueue.dequeueNoWait())
!= null) {
                 try {
                     JmsMessage copy = null;
-                    if(acknowledgementMode == Session.AUTO_ACKNOWLEDGE) {
+                    if (acknowledgementMode == Session.AUTO_ACKNOWLEDGE) {
                         copy = copy(doAckDelivered(envelope));
                     } else {
                         copy = copy(ackFromReceive(envelope));
@@ -557,7 +559,7 @@ public class JmsMessageConsumer implements MessageConsumer, JmsMessageAvailableC
 
                     messageListener.onMessage(copy);
 
-                    if(acknowledgementMode == Session.AUTO_ACKNOWLEDGE && !session.isSessionRecovered())
{
+                    if (acknowledgementMode == Session.AUTO_ACKNOWLEDGE && !session.isSessionRecovered())
{
                         doAckConsumed(envelope);
                     }
                 } catch (Exception e) {
@@ -570,5 +572,4 @@ public class JmsMessageConsumer implements MessageConsumer, JmsMessageAvailableC
             }
         }
     }
-
 }


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


Mime
View raw message