118 lines
7.8 KiB
XML
118 lines
7.8 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
||
<!-- ============================================================================= -->
|
||
<!-- Copyright © 2009 Red Hat, Inc. and others. -->
|
||
<!-- -->
|
||
<!-- The text of and illustrations in this document are licensed by Red Hat under -->
|
||
<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
|
||
<!-- -->
|
||
<!-- An explanation of CC-BY-SA is available at -->
|
||
<!-- -->
|
||
<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
|
||
<!-- -->
|
||
<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
|
||
<!-- of it, you must provide the URL for the original version. -->
|
||
<!-- -->
|
||
<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
|
||
<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
|
||
<!-- permitted by applicable law. -->
|
||
<!-- ============================================================================= -->
|
||
|
||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||
<!ENTITY % BOOK_ENTITIES SYSTEM "ActiveMQ_User_Manual.ent">
|
||
%BOOK_ENTITIES;
|
||
]>
|
||
<chapter id="tools">
|
||
<title>Tools</title>
|
||
|
||
<para>ActiveMQ ships with several helpful command line tools. All tools are available from the activemq-tools-<version>-jar-with-dependencies.jar.
|
||
As the name suggests, this Java archive contains ActiveMQ along with all of its dependencies. This is done to
|
||
simplify the execution of the tools by eliminating the need so specify a classpath. These tools are:</para>
|
||
<itemizedlist>
|
||
<listitem>
|
||
<para><emphasis role="bold"><literal>print-data</literal></emphasis>. Used for low-level inspection of the bindings and message journals. It
|
||
takes two parameters - <literal>bindings-directory</literal> and <literal>journal-directory</literal>. These
|
||
are the paths to the directories where the bindings and message journals are stored, respectively. For
|
||
example:
|
||
</para>
|
||
<programlisting>java -jar activemq-tools-<version>-jar-with-dependencies.jar print-data /home/user/activemq/data/bindings /home/user/activemq/data/journal</programlisting>
|
||
</listitem>
|
||
<listitem>
|
||
<para><emphasis role="bold"><literal>print-pages</literal></emphasis>. Used for low-level inspection of paged message data. It takes two
|
||
parameters - <literal>paging-directory</literal> and <literal>journal-directory</literal>. These are the
|
||
paths to the directories where paged messages and the message journals are stored, respectively. For
|
||
example:
|
||
</para>
|
||
<programlisting>java -jar activemq-tools-<version>-jar-with-dependencies.jar print-pages /home/user/activemq/data/paging-directory /home/user/activemq/data/journal</programlisting>
|
||
</listitem>
|
||
<listitem>
|
||
<para><emphasis role="bold"><literal>export</literal></emphasis>. Used for exporting all binding and message data (including paged and large
|
||
messages) as well as JMS destinations and connection factories (including JNDI bindings). The export is
|
||
structured as XML. This data can then be imported to another server even if the server is a different
|
||
version than the original. It takes 4 parameters:
|
||
</para>
|
||
<itemizedlist>
|
||
<listitem>
|
||
<para><literal>bindings-directory</literal> - the path to the bindings directory.</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>journal-directory</literal> - the path to the journal directory.</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>paging-directory</literal> - the path to the paging directory.</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>large-messages-directory</literal> - the path to the large-messages directory.</para>
|
||
</listitem>
|
||
</itemizedlist>
|
||
<para>Here's an example:</para>
|
||
<programlisting>java -jar activemq-tools-<version>-jar-with-dependencies.jar export /home/user/activemq/data/bindings-directory /home/user/activemq/data/journal-directory /home/user/activemq/data/paging-directory /home/user/activemq/data/large-messages</programlisting>
|
||
<para>This tool will export directly to standard out so if the data needs to be stored in a file please
|
||
redirect as appropriate for the operation system in use. Also, please note that the <literal>export</literal>
|
||
tool is single threaded so depending on the size of the journal it could take awhile to complete.
|
||
</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><emphasis role="bold"><literal>import</literal></emphasis>. Used for importing data from an XML document generated by the
|
||
<literal>export</literal> tool. The <literal>import</literal> tool reads the XML document and connects
|
||
to a ActiveMQ server via Netty to import all the data. It takes 5 parameters:
|
||
</para>
|
||
<itemizedlist>
|
||
<listitem>
|
||
<para><literal>input-file</literal> - the path to the XML file generated by the <literal>export</literal>
|
||
tool.
|
||
</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>host</literal> - the IP address or hostname of the server where the data should be
|
||
imported.
|
||
</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>port</literal> - the port where ActiveMQ is listening.</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>transactional</literal> - a <literal>boolean</literal> flag to indicate whether or not to
|
||
send all the <emphasis>message</emphasis> data in a single transaction. Valid values are <literal>true</literal>
|
||
or <literal>false</literal>.
|
||
</para>
|
||
</listitem>
|
||
<listitem>
|
||
<para><literal>application-server-compatibility</literal> - a <literal>boolean</literal> flag to indicate
|
||
whether or not JNDI bindings need special treatment to account for the way JBoss AS7, Wildfly, and
|
||
JBoss EAP 6 handle JNDI for remote clients. Each of these application servers require a special JNDI
|
||
binding to allow access from remote clients. If this is <literal>true</literal> then every JNDI
|
||
binding in the XML will be duplicated in the "java:jboss/exported/" namespace thus allowing both local
|
||
and remote clients to use the same name when accessing resources via JNDI. Valid values are
|
||
<literal>true</literal> or <literal>false</literal>.
|
||
</para>
|
||
</listitem>
|
||
</itemizedlist>
|
||
<para>Here's an example:</para>
|
||
<programlisting>java -jar activemq-tools-<version>-jar-with-dependencies.jar import /home/user/exportData.xml 127.0.0.1 5445 false false</programlisting>
|
||
<para>Like the <literal>export</literal> tool the <literal>import</literal> tool is single threaded so
|
||
depending on the size of the XML file it may take awhile for the process to complete.
|
||
</para>
|
||
</listitem>
|
||
</itemizedlist>
|
||
</chapter>
|