You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2020/03/02 16:57:14 UTC

[activemq] branch activemq-5.15.x updated: [AMQ-7314] Fix counter increment when lastDelivereSeqId > BrokerSequenceId

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch activemq-5.15.x
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/activemq-5.15.x by this push:
     new 6d2560f  [AMQ-7314] Fix counter increment when lastDelivereSeqId > BrokerSequenceId
6d2560f is described below

commit 6d2560f7e35b12e73bf9f82cb235dc32855271f5
Author: jbonofre <jb...@apache.org>
AuthorDate: Mon Mar 2 15:31:16 2020 +0100

    [AMQ-7314] Fix counter increment when lastDelivereSeqId > BrokerSequenceId
    
    (cherry picked from commit df1750fe01a6e31573e3bc66ee342402963fd014)
---
 .../src/main/java/org/apache/activemq/broker/region/Queue.java        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
index 86471ec..37ac0da 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
@@ -528,11 +528,11 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
                 // locate last redelivered in unconsumed list (list in delivery rather than seq order)
                 if (lastDeliveredSequenceId > RemoveInfo.LAST_DELIVERED_UNSET) {
                     for (MessageReference ref : unAckedMessages) {
-                        if (ref.getMessageId().getBrokerSequenceId() == lastDeliveredSequenceId) {
+                        LOG.debug("UnAck reference message id: {}, reference message broker sequence id: {}", ref.getMessageId(), ref.getMessageId().getBrokerSequenceId());
+                        if (lastDeliveredSequenceId == 0 || (lastDeliveredSequenceId > 0 && ref.getMessageId().getBrokerSequenceId() <= lastDeliveredSequenceId)) {
                             lastDeliveredRef = ref;
                             markAsRedelivered = true;
                             LOG.debug("found lastDeliveredSeqID: {}, message reference: {}", lastDeliveredSequenceId, ref.getMessageId());
-                            break;
                         }
                     }
                 }