ARTEMIS-432 client gets msg after session stop
This commit is contained in:
parent
4ba11c8bbc
commit
196f0ca8d6
|
@ -344,12 +344,12 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener {
|
||||||
ref.getQueue().acknowledge(ref);
|
ref.getQueue().acknowledge(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (message.isLargeMessage() && this.supportLargeMessage) {
|
if (message.isLargeMessage() && this.supportLargeMessage) {
|
||||||
largeMessageDeliverer = new LargeMessageDeliverer((LargeServerMessage) message, ref);
|
largeMessageDeliverer = new LargeMessageDeliverer((LargeServerMessage) message, ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
lockDelivery.readLock().lock();
|
lockDelivery.readLock().lock();
|
||||||
|
|
||||||
return HandleStatus.HANDLED;
|
return HandleStatus.HANDLED;
|
||||||
|
@ -559,8 +559,14 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener {
|
||||||
@Override
|
@Override
|
||||||
public void setStarted(final boolean started) {
|
public void setStarted(final boolean started) {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
|
lockDelivery.writeLock().lock();
|
||||||
|
try {
|
||||||
this.started = browseOnly || started;
|
this.started = browseOnly || started;
|
||||||
}
|
}
|
||||||
|
finally {
|
||||||
|
lockDelivery.writeLock().unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Outside the lock
|
// Outside the lock
|
||||||
if (started) {
|
if (started) {
|
||||||
|
@ -966,6 +972,10 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener {
|
||||||
public boolean deliver() throws Exception {
|
public boolean deliver() throws Exception {
|
||||||
lockDelivery.readLock().lock();
|
lockDelivery.readLock().lock();
|
||||||
try {
|
try {
|
||||||
|
if (!started) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
LargeServerMessage currentLargeMessage = largeMessage;
|
LargeServerMessage currentLargeMessage = largeMessage;
|
||||||
if (currentLargeMessage == null) {
|
if (currentLargeMessage == null) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue