ARTEMIS-432 client gets msg after session stop

This commit is contained in:
jbertram 2016-03-10 17:11:14 -06:00 committed by Clebert Suconic
parent 4ba11c8bbc
commit 196f0ca8d6
1 changed files with 14 additions and 4 deletions

View File

@ -344,12 +344,12 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener {
ref.getQueue().acknowledge(ref);
}
}
if (message.isLargeMessage() && this.supportLargeMessage) {
largeMessageDeliverer = new LargeMessageDeliverer((LargeServerMessage) message, ref);
}
}
lockDelivery.readLock().lock();
return HandleStatus.HANDLED;
@ -559,8 +559,14 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener {
@Override
public void setStarted(final boolean started) {
synchronized (lock) {
lockDelivery.writeLock().lock();
try {
this.started = browseOnly || started;
}
finally {
lockDelivery.writeLock().unlock();
}
}
// Outside the lock
if (started) {
@ -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;