I was thinking about writing a similar utility.  Artemis has an importer which 
will read an XML document that I think would be useful for this task.  If the 
KahaDB can be exported to the proper XML format then the utility's work will be 
done.  Unfortunately the XML format isn't specifically documented, but it's 
pretty simple.  Here's a quick example:

<?xml version="1.0"?>
<activemq-journal>
   <bindings>
      <binding address="A1" filter-string="" queue-name="A1" id="3"/>
   </bindings>
   <messages>
      <message id="5" priority="4" expiration="0" timestamp="1485960285602" 
type="default">
         <properties>
            <property name="myDoubleProperty" value="0.0" type="double"/>
            <property name="myBooleanProperty" value="true" type="boolean"/>
            <property name="myShortProperty" value="0" type="short"/>
            <property name="myNullObjectProperty" value="_AMQ_NULL"/>
            <property name="mySimpleStringProperty" 
value="mySimpleStringPropertyValue_0" type="simple-string"/>
            <property name="myIntProperty" value="0" type="integer"/>
            <property name="myBytesProperty" value="AAECAwQ=" type="bytes"/>
            <property name="myLongProperty" value="9223372036854775807" 
type="long"/>
            <property name="myFloatProperty" value="0.0" type="float"/>
            <property name="myStringProperty" value="myStringPropertyValue_0" 
type="simple-string"/>
         </properties>
         <queues>
            <queue name="A1"/>
         </queues>
         <body>
            <![CDATA[AAAAEwATQm9iIHRoZSBnaWFudCBwaWcgMA==]]>
         </body>
      </message>
   </messages>
</activemq-journal>

Byte arrays (e.g. for message bodies and "bytes" properties) are Base64 encoded 
using org.apache.activemq.artemis.utils.Base64 (which the export utility could 
easily use).  The XmlDataExporter and XmlDataImporter are in 
org.apache.activemq.artemis.cli.commands.tools.

What do you think?


Justin

----- Original Message -----
From: "Christopher Shannon" <[email protected]>
To: [email protected]
Sent: Wednesday, February 1, 2017 6:44:56 AM
Subject: [DISCUSS] ActiveMQ utility project name

I'm going to ping infra to create a new project but wanted to get some
feedback from people first. The main motivation for this utility project is
to create some command line store utilities for things like migrating a
KahaDB store to an Artemis store.

I could request the name to be 'activemq-store-tools' or something like
that but we could also make it more generic such as 'activemq-cli-tools' or
even just simply 'activemq-tools' if there is other stuff we wanted to put
in there.  Thoughts?

Reply via email to