activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/2] activemq-artemis git commit: ARTEMIS-432 client gets msg after session stop
Date Fri, 11 Mar 2016 20:33:35 GMT
ARTEMIS-432 client gets msg after session stop


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

Branch: refs/heads/master
Commit: 196f0ca8d6b9e91f042481e3595105f29c3f01bd
Parents: 4ba11c8
Author: jbertram <jbertram@apache.org>
Authored: Thu Mar 10 17:11:14 2016 -0600
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Fri Mar 11 15:33:28 2016 -0500

----------------------------------------------------------------------
 .../core/server/impl/ServerConsumerImpl.java      | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/196f0ca8/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
index 25c657e..1f2be69 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java
@@ -344,10 +344,10 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener
{
                ref.getQueue().acknowledge(ref);
             }
 
-         }
+            if (message.isLargeMessage() && this.supportLargeMessage) {
+               largeMessageDeliverer = new LargeMessageDeliverer((LargeServerMessage) message,
ref);
+            }
 
-         if (message.isLargeMessage() && this.supportLargeMessage) {
-            largeMessageDeliverer = new LargeMessageDeliverer((LargeServerMessage) message,
ref);
          }
 
          lockDelivery.readLock().lock();
@@ -559,7 +559,13 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener
{
    @Override
    public void setStarted(final boolean started) {
       synchronized (lock) {
-         this.started = browseOnly || started;
+         lockDelivery.writeLock().lock();
+         try {
+            this.started = browseOnly || started;
+         }
+         finally {
+            lockDelivery.writeLock().unlock();
+         }
       }
 
       // Outside the lock
@@ -966,6 +972,10 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener
{
       public boolean deliver() throws Exception {
          lockDelivery.readLock().lock();
          try {
+            if (!started) {
+               return false;
+            }
+
             LargeServerMessage currentLargeMessage = largeMessage;
             if (currentLargeMessage == null) {
                return true;


Mime
View raw message