activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject activemq-artemis git commit: fixing exporter tool
Date Sat, 04 Mar 2017 06:12:27 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/artemis-1009 158455620 -> 1d521b87c


fixing exporter tool


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/1d521b87
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/1d521b87
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/1d521b87

Branch: refs/heads/artemis-1009
Commit: 1d521b87cf4e91315e9cd17d621222c88002e406
Parents: 1584556
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Sat Mar 4 01:07:12 2017 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Sat Mar 4 01:12:20 2017 -0500

----------------------------------------------------------------------
 .../artemis/cli/commands/tools/XmlDataExporter.java         | 4 +++-
 .../artemis/cli/commands/tools/XmlDataExporterUtil.java     | 9 ++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1d521b87/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
index b53db48..4638df7 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporter.java
@@ -218,7 +218,9 @@ public final class XmlDataExporter extends OptionalLocking {
 
          Object o = DescribeJournal.newObjectEncoding(info, storageManager);
          if (info.getUserRecordType() == JournalRecordIds.ADD_MESSAGE) {
-            messages.put(info.id, ((MessageDescribe) o).getMsg());
+            messages.put(info.id, ((MessageDescribe) o).getMsg().toCore());
+         } else if (info.getUserRecordType() == JournalRecordIds.ADD_MESSAGE_PROTOCOL) {
+            messages.put(info.id, ((MessageDescribe) o).getMsg().toCore());
          } else if (info.getUserRecordType() == JournalRecordIds.ADD_LARGE_MESSAGE) {
             messages.put(info.id, ((MessageDescribe) o).getMsg());
          } else if (info.getUserRecordType() == JournalRecordIds.ADD_REF) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/1d521b87/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporterUtil.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporterUtil.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporterUtil.java
index ca7f1a8..7711648 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporterUtil.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/XmlDataExporterUtil.java
@@ -17,7 +17,7 @@
 package org.apache.activemq.artemis.cli.commands.tools;
 
 import com.google.common.base.Preconditions;
-import org.apache.activemq.artemis.api.core.ICoreMessage;
+import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.utils.Base64;
@@ -94,10 +94,9 @@ public class XmlDataExporterUtil {
    public static String encodeMessageBody(final Message message) throws Exception {
       Preconditions.checkNotNull(message, "ServerMessage can not be null");
 
-      ICoreMessage coreMessage = message.toCore();
-      int size = coreMessage.getEndOfBodyPosition() - coreMessage.getBodyBuffer().readerIndex();
-      byte[] buffer = new byte[size];
-      message.toCore().getBodyBuffer().readBytes(buffer);
+      ActiveMQBuffer byteBuffer = message.toCore().getReadOnlyBodyBuffer();
+      byte[] buffer = new byte[byteBuffer.writerIndex()];
+      byteBuffer.readBytes(buffer);
 
       return XmlDataExporterUtil.encode(buffer);
    }


Mime
View raw message