117 lines
7.7 KiB
XML
117 lines
7.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- ============================================================================= -->
|
|
<!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
|
|
<!-- contributor license agreements. See the NOTICE file distributed with -->
|
|
<!-- this work for additional information regarding copyright ownership. -->
|
|
<!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
|
|
<!-- (the "License"); you may not use this file except in compliance with -->
|
|
<!-- the License. You may obtain a copy of the License at -->
|
|
<!-- -->
|
|
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
|
|
<!-- -->
|
|
<!-- Unless required by applicable law or agreed to in writing, software -->
|
|
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
|
|
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
|
|
<!-- See the License for the specific language governing permissions and -->
|
|
<!-- limitations under the License. -->
|
|
<!-- ============================================================================= -->
|
|
|
|
<!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>
|