[ARTEMIS-502] AMQ224044, error acknowledging message: java.lang.NullPointerException, can happen sometimes during load

This commit is contained in:
Ingo Weiss 2016-04-25 09:56:51 +01:00 committed by Martyn Taylor
parent d947741a92
commit 82019cb3be
1 changed files with 5 additions and 0 deletions

View File

@ -930,6 +930,11 @@ public class ServerConsumerImpl implements ServerConsumer, ReadyListener {
synchronized (lock) {
// This is an optimization, if the reference is the first one, we just poll it.
// But first we need to make sure deliveringRefs isn't empty
if (deliveringRefs.isEmpty()) {
return null;
}
if (deliveringRefs.peek().getMessage().getMessageID() == messageID) {
return deliveringRefs.poll();
}