activemq-cli-tools git commit: AMQCLI-3 - improve logging

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

activemq-cli-tools git commit: AMQCLI-3 - improve logging

cshannon
Repository: activemq-cli-tools
Updated Branches:
  refs/heads/master 4d14839b5 -> 825cb468e


AMQCLI-3 - improve logging


Project: http://git-wip-us.apache.org/repos/asf/activemq-cli-tools/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-cli-tools/commit/825cb468
Tree: http://git-wip-us.apache.org/repos/asf/activemq-cli-tools/tree/825cb468
Diff: http://git-wip-us.apache.org/repos/asf/activemq-cli-tools/diff/825cb468

Branch: refs/heads/master
Commit: 825cb468ef00846e1bb0bc83e24880b92c4b59f6
Parents: 4d14839
Author: Christopher L. Shannon (cshannon) <[hidden email]>
Authored: Mon Mar 13 09:02:06 2017 -0400
Committer: Christopher L. Shannon (cshannon) <[hidden email]>
Committed: Mon Mar 13 09:02:06 2017 -0400

----------------------------------------------------------------------
 .../activemq/cli/kahadb/exporter/KahaDBExporter.java      | 10 ++++++++--
 .../exporter/artemis/ArtemisXmlMetadataExporter.java      |  1 -
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-cli-tools/blob/825cb468/activemq-kahadb-exporter/src/main/java/org/apache/activemq/cli/kahadb/exporter/KahaDBExporter.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-exporter/src/main/java/org/apache/activemq/cli/kahadb/exporter/KahaDBExporter.java b/activemq-kahadb-exporter/src/main/java/org/apache/activemq/cli/kahadb/exporter/KahaDBExporter.java
index ba5a0ef..f4801a1 100644
--- a/activemq-kahadb-exporter/src/main/java/org/apache/activemq/cli/kahadb/exporter/KahaDBExporter.java
+++ b/activemq-kahadb-exporter/src/main/java/org/apache/activemq/cli/kahadb/exporter/KahaDBExporter.java
@@ -23,6 +23,7 @@ import java.util.Set;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
+import org.apache.activemq.artemis.utils.SizeFormatterUtil;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQQueue;
 import org.apache.activemq.command.ActiveMQTopic;
@@ -91,15 +92,20 @@ public class KahaDBExporter implements MessageStoreExporter {
 
         // loop through all queues and export them
         for (final ActiveMQDestination destination : destinations) {
-
-            LOG.info("Starting export of: " + destination);
             final MessageStore messageStore = destination.isQueue() ?
                     adapter.createQueueMessageStore((ActiveMQQueue) destination) :
                     adapter.createTopicMessageStore((ActiveMQTopic) destination);
 
             try {
+                messageStore.start();
+
+                LOG.info("Starting export of: {}; message count: {} message(s); message size: {}", destination,
+                        messageStore.getMessageCount(), SizeFormatterUtil.sizeof(
+                                messageStore.getMessageSize()));
+
                 // migrate the data
                 messageStore.recover(recoveryListener);
+                messageStore.stop();
             } catch (Exception e) {
                 IOExceptionSupport.create(e);
             }

http://git-wip-us.apache.org/repos/asf/activemq-cli-tools/blob/825cb468/activemq-kahadb-exporter/src/main/java/org/apache/activemq/cli/kahadb/exporter/artemis/ArtemisXmlMetadataExporter.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-exporter/src/main/java/org/apache/activemq/cli/kahadb/exporter/artemis/ArtemisXmlMetadataExporter.java b/activemq-kahadb-exporter/src/main/java/org/apache/activemq/cli/kahadb/exporter/artemis/ArtemisXmlMetadataExporter.java
index 216a6a3..d915ec9 100644
--- a/activemq-kahadb-exporter/src/main/java/org/apache/activemq/cli/kahadb/exporter/artemis/ArtemisXmlMetadataExporter.java
+++ b/activemq-kahadb-exporter/src/main/java/org/apache/activemq/cli/kahadb/exporter/artemis/ArtemisXmlMetadataExporter.java
@@ -25,7 +25,6 @@ import org.apache.activemq.cli.kahadb.exporter.MessageStoreMetadataExporter;
 import org.apache.activemq.cli.schema.QueueBindingType;
 import org.apache.activemq.command.ActiveMQTopic;
 import org.apache.activemq.command.SubscriptionInfo;
-import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;
 import org.apache.activemq.store.kahadb.KahaDBStore;
 
 public class ArtemisXmlMetadataExporter implements MessageStoreMetadataExporter {