From f9aa0a98b438068d8113c6cf4457d674bf07599d Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 4 Aug 2021 17:18:15 -0400 Subject: [PATCH] ARTEMIS-3411 Add PrintData information on Divert records --- .../activemq/artemis/core/config/DivertConfiguration.java | 5 +++++ .../persistence/config/PersistedDivertConfiguration.java | 5 +++++ .../core/persistence/impl/journal/DescribeJournal.java | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/DivertConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/DivertConfiguration.java index d767c16fa9..a10e97774f 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/DivertConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/DivertConfiguration.java @@ -259,6 +259,11 @@ public class DivertConfiguration implements Serializable, EncodingSupport { } } + @Override + public String toString() { + return "DivertConfiguration{" + "name='" + name + '\'' + ", routingName='" + routingName + '\'' + ", address='" + address + '\'' + ", forwardingAddress='" + forwardingAddress + '\'' + ", exclusive=" + exclusive + ", filterString='" + filterString + '\'' + ", transformerConfiguration=" + transformerConfiguration + '}'; + } + @Override public void decode(ActiveMQBuffer buffer) { name = buffer.readNullableString(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedDivertConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedDivertConfiguration.java index 7a5a88d9bd..67860bcc0d 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedDivertConfiguration.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/config/PersistedDivertConfiguration.java @@ -26,6 +26,11 @@ public class PersistedDivertConfiguration implements EncodingSupport { private DivertConfiguration divertConfiguration; + @Override + public String toString() { + return "PersistedDivertConfiguration{" + "storeId=" + storeId + ", divertConfiguration=" + divertConfiguration + '}'; + } + public PersistedDivertConfiguration(DivertConfiguration divertConfiguration) { this.divertConfiguration = divertConfiguration; } diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java index a6a0ad1753..7a7b125071 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/DescribeJournal.java @@ -45,6 +45,7 @@ import org.apache.activemq.artemis.core.journal.impl.JournalImpl; import org.apache.activemq.artemis.core.journal.impl.JournalReaderCallback; import org.apache.activemq.artemis.core.paging.cursor.impl.PageSubscriptionCounterImpl; import org.apache.activemq.artemis.core.paging.impl.PageTransactionInfoImpl; +import org.apache.activemq.artemis.core.persistence.config.PersistedDivertConfiguration; import org.apache.activemq.artemis.core.persistence.impl.journal.BatchingIDGenerator.IDCounterEncoding; import org.apache.activemq.artemis.core.persistence.impl.journal.codec.CursorAckRecordEncoding; import org.apache.activemq.artemis.core.persistence.impl.journal.codec.DeliveryCountUpdateEncoding; @@ -80,6 +81,7 @@ import static org.apache.activemq.artemis.core.persistence.impl.journal.JournalR import static org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds.ADD_MESSAGE; import static org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds.ADD_MESSAGE_PROTOCOL; import static org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds.ADD_REF; +import static org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds.DIVERT_RECORD; import static org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds.DUPLICATE_ID; import static org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds.HEURISTIC_COMPLETION; import static org.apache.activemq.artemis.core.persistence.impl.journal.JournalRecordIds.ID_COUNTER_RECORD; @@ -577,6 +579,11 @@ public final class DescribeJournal { int rec = info.getUserRecordType(); switch (rec) { + case DIVERT_RECORD: + PersistedDivertConfiguration persistedDivertConfiguration = new PersistedDivertConfiguration(); + persistedDivertConfiguration.decode(buffer); + return persistedDivertConfiguration; + case ADD_LARGE_MESSAGE_PENDING: { PendingLargeMessageEncoding lmEncoding = new PendingLargeMessageEncoding(); lmEncoding.decode(buffer);