Chapter 24. Command-Line Tools
AMQ Broker includes a set of command-line interface (CLI) commands that you can use to manage some aspects of your broker.
The table below describes each CLI command.
| Command | Description |
|---|---|
| pwd | Provides information on current folder and instance. |
| producer | Sends message(s) to a broker. |
| transfer | Moves messages from one JMS destination towards another JMS destination. |
| consumer | Consumes messages from a queue. |
| browser | Browses messages on a queue. |
| mask | Encrypts passwords and URLs in configuration files. |
| version | Prints version information. |
| perf | Tests the performance of the broker. |
| check | Performs checks on a node, queue or cluster. |
| queue | Creates, deletes, updates and obtains statistics for queues, and purges messages in a queue. |
| address | Creates, deletes, updates and shows addresses. |
| activation | Recovers activation state information for a failed replication configuration. |
| data | Runs data maintenance. |
| user | File-based user management. |
| run | Runs the broker. |
| stop | Stops the broker. |
| kill | Kills a broker started with --allow-kill. |
| perf-journal | Calculates the journal-buffer-timeout to use with the current data folder. |
| completion | Generates the auto complete script file for use in a bash or zsh shell. |
For a full list of sub-commands available for each command, use the help parameter followed by the command name. For example, type ./artemis help data to get a list of sub-commands available for the artemis data command.
Usage: artemis data [COMMAND]
use 'help data' for sub commands list
Commands:
recover Recover (undelete) every message on the journal by creating a new
output journal. Rolled back and acked messages will be sent out to
the output as much as possible.
print Print data records information. WARNING: don't use while
a production server is running.
exp Export all message-data using an XML that could be
interpreted by any system.
imp Import all message-data using an XML that could be
interpreted by any system.
decode Decode a journal's internal format into a new set
of journal files.
encode Encode a set of journal files into an internal
encoded data format.
compact Compact the journal of a non running server.
You can also use the 'help' parameter to get information for a sub-command. For example, type ./artemis help data print to get a list of options available for the artemis data print sub-command.
Usage: artemis data print [--f] [--jdbc] [--reclaimed] [--safe]
[--skip-bindings] [--skip-journal] [--verbose]
[--bindings=<binding>] [--broker=<brokerConfig>]
[--jdbc-bindings-table-name=<jdbcBindings>]
[--jdbc-connection-url=<jdbcURL>]
[--jdbc-driver-class-name=<jdbcClassName>]
[--jdbc-large-message-table-name=<jdbcLargeMessages>]
[--jdbc-message-table-name=<jdbcMessages>]
[--jdbc-node-manager-table-name=<jdbcNodeManager>]
[--jdbc-page-store-table-name=<jdbcPageStore>]
[--jdbc-password=<jdbcPassword>]
[--jdbc-user=<jdbcUser>] [--journal=<journal>]
[--large-messages=<largeMessges>]
[--max-pages=<maxPages>] [--output=<output>]
[--paging=<paging>] <configuration>
Print data records information. WARNING: don't use while a production server is running.
<configuration>
Broker Configuration URI.
Default: xml: null/etc/bootstrap.xml.
--bindings=<binding> The folder used for bindings.
Default: read from broker.xml.
--broker=<brokerConfig>
Override the broker configuration from the
bootstrap.xml.
--f This will allow certain tools like print-data to be
performed ignoring any running servers.
WARNING: Changing data concurrently with a
running broker may damage your data.
Be careful with this option.
--jdbc Whether to store message data in JDBC
instead of local files.
--jdbc-bindings-table-name=<jdbcBindings>
Name of the jdbc bindings table.
--jdbc-connection-url=<jdbcURL>
The URL used for the database connection.
--jdbc-driver-class-name=<jdbcClassName>
JDBC driver classname.
--jdbc-large-message-table-name=<jdbcLargeMessages>
Name of the large messages table.
--jdbc-message-table-name=<jdbcMessages>
Name of the jdbc messages table.
--jdbc-node-manager-table-name=<jdbcNodeManager>
Name of the jdbc node manager table.
--jdbc-page-store-table-name=<jdbcPageStore>
Name of the page store messages table.
--jdbc-password=<jdbcPassword>
JDBC password.
--jdbc-user=<jdbcUser> JDBC username.
--journal=<journal> The folder used for normal messages.
Default: read from broker.xml.
--large-messages=<largeMessges>
The folder used for large-messages.
Default: read from broker.xml.
--max-pages=<maxPages> Maximum number of pages to read.
Default: unlimited (-1).
--output=<output> Output name for the file.
--paging=<paging> The folder used for paged messages.
Default: read from broker.xml.
--reclaimed Try to print as many records as possible
from reclaimed files.
--safe Print your data structure without showing your
--skip-bindings Do not print data from the bindings journal.
--skip-journal Do not print data from the messages journal.
--verbose Print additional information.