You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2022/10/18 17:49:41 UTC

[activemq-artemis] branch main updated (b388a24b26 -> 51c50d8546)

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

clebertsuconic pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


    from b388a24b26 ARTEMIS-4056 Paging Management optimizations
     new 77ad2b0bc0 ARTEMIS-4056 Expanding nextPage check into isDeleted
     new 51c50d8546 ARTEMIS-4056 Fixing compatibility with getFirstMessage()

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../activemq/artemis/core/management/impl/QueueControlImpl.java      | 5 +++--
 .../artemis/core/paging/cursor/impl/PageSubscriptionImpl.java        | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)


[activemq-artemis] 01/02: ARTEMIS-4056 Expanding nextPage check into isDeleted

Posted by cl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 77ad2b0bc0aff353b6d535aee1351ae49c7bb501
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Tue Oct 18 11:51:47 2022 -0400

    ARTEMIS-4056 Expanding nextPage check into isDeleted
---
 .../activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java
index 3be9037fb9..cdbd1dba72 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/cursor/impl/PageSubscriptionImpl.java
@@ -1508,7 +1508,8 @@ public final class PageSubscriptionImpl implements PageSubscription {
 
          while (page <= pageStore.getCurrentWritingPage()) {
             PageCursorInfo info = locatePageInfo(page);
-            if (info == null || info.getCompleteInfo() == null) {
+            // if pendingDelete or complete, we just move to next page
+            if (info == null || info.getCompleteInfo() == null && !info.isPendingDelete()) {
                return page;
             }
             if (logger.isDebugEnabled()) {


[activemq-artemis] 02/02: ARTEMIS-4056 Fixing compatibility with getFirstMessage()

Posted by cl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 51c50d8546adef7132728f65e785dff4f0d4e3bf
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Tue Oct 18 13:42:12 2022 -0400

    ARTEMIS-4056 Fixing compatibility with getFirstMessage()
    
    if Empty the previous method was returning new Map[1] and the JSON output would be slightly different and I am playing safe here just in case.
---
 .../activemq/artemis/core/management/impl/QueueControlImpl.java      | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
index 5e31da5aeb..1fbefc3847 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
@@ -888,7 +888,6 @@ public class QueueControlImpl extends AbstractControl implements QueueControl {
 
       clearIO();
       try {
-         List<Map<String, Object>> messages = new ArrayList<>();
          final int attributeSizeLimit = addressSettingsRepository.getMatch(address).getManagementMessageAttributeSizeLimit();
          MessageReference firstMessage = queue.peekFirstMessage();
          if (firstMessage != null) {
@@ -908,7 +907,9 @@ public class QueueControlImpl extends AbstractControl implements QueueControl {
          AuditLogger.getFirstMessageAsJSON(queue);
       }
       Map<String, Object> message = getFirstMessage();
-      return toJSON(message == null ? new Map[0] : new Map[]{message});
+      // I"m returning a new Map[1] in case of no first message, because older versions used to return that when null
+      // and I'm playing safe with the compatibility here.
+      return toJSON(message == null ? new Map[1] : new Map[]{message});
    }
 
    @Override