| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <meta name="generator" content="Asciidoctor 2.0.18"> |
| <link rel="icon" type="image/png" href="images/favicon.png"> |
| <title>Command Line Interface</title> |
| <link rel="stylesheet" href="css/asciidoctor.css"> |
| <link rel="stylesheet" href="css/font-awesome.css"> |
| <link rel="stylesheet" href="css/rouge-github.css"> |
| </head> |
| <body class="book toc2 toc-left"> |
| <div id="header"> |
| <h1>Command Line Interface</h1> |
| <div id="toc" class="toc2"> |
| <div id="toctitle"><a href="index.html">User Manual for 2.32.0</a></div> |
| <ul class="sectlevel1"> |
| <li><a href="#getting-help">1. Getting Help</a></li> |
| <li><a href="#bash-and-zsh-auto-complete">2. Bash and Zsh auto complete</a></li> |
| <li><a href="#input-required">3. Input required</a></li> |
| <li><a href="#artemis-shell">4. Artemis Shell</a> |
| <ul class="sectlevel2"> |
| <li><a href="#connecting-interactively">4.1. Connecting Interactively</a></li> |
| <li><a href="#connecting-statically">4.2. Connecting Statically</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <div id="content"> |
| <div id="preamble"> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>ActiveMQ Artemis has a Command Line Interface (CLI) that can used to manage a few aspects of the broker like instance creation, basic user management, queue & address management, etc.</p> |
| </div> |
| <div class="paragraph"> |
| <p>There are two ways the CLI can be used:</p> |
| </div> |
| <div class="ulist"> |
| <ul> |
| <li> |
| <p>Traditional CLI commands, e.g.: <code>./artemis [COMMAND] [PARAMETERS]</code></p> |
| </li> |
| <li> |
| <p>A custom shell that is accesssed using the <code>./artemis</code> or <code>./artemis shell</code> commands.</p> |
| </li> |
| </ul> |
| </div> |
| <div class="paragraph"> |
| <p>All commands available through the traditional CLI commands are also available through the shell interface.</p> |
| </div> |
| <div class="paragraph"> |
| <p>One benefit of the traditional CLI commands is that they can be used in your own bash scripts for automation, etc.</p> |
| </div> |
| <div class="paragraph"> |
| <p>One benefit of the shell is that it will <strong>reuse</strong> some information as you repeat commands. |
| For example, once you supply the broker URI and username & password to one command those values will be transparently applied other commands in the same shell session. |
| Of course, the shell also allows you to avoid retyping <code>./artemis</code> for every command.</p> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="getting-help"><a class="anchor" href="#getting-help"></a><a class="link" href="#getting-help">1. Getting Help</a></h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>You can get a complete list of available commands by typing:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span>./artemis <span class="nb">help</span> |
| <span class="go">Usage: artemis [COMMAND] |
| ActiveMQ Artemis Command Line |
| Commands: |
| </span><span class="gp"> help use 'help <command></span><span class="s1">' for more information |
| </span><span class="go"> auto-complete Generates the auto complete script file to be used in bash or |
| zsh. |
| shell JLine3 shell helping using the CLI |
| producer Send message(s) to a broker. |
| transfer Move messages from one destination towards another destination. |
| consumer Consume messages from a queue. |
| browser Browse messages on a queue. |
| mask Mask a password and print it out. |
| version Print version information. |
| perf use 'help perf' for sub commands list |
| check use 'help check' for sub commands list |
| queue use 'help check' for sub commands list |
| address use 'help address' for sub commands list |
| data use 'help data' for sub commands list |
| create Create a new broker instance. |
| upgrade Update a broker instance to the current artemis.home, keeping |
| all the data and broker.xml. Warning: backup your instance |
| before using this command and compare the files.</span></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>It is also possible to use <code>help</code> at a specific command or sub-command for more information. |
| For example, to get a list of sub-commands for <code>data</code> you type <code>./artemis help data</code>:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span>./artemis <span class="nb">help </span>data |
| <span class="go">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.</span></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Or you can get help for a particular command. |
| For example, <code>./artemis help create</code>:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="go">Usage: artemis create [--aio] [--allow-anonymous] [--autocreate] [--autodelete] |
| [--backup] [--blocking] [--clustered] |
| [--disable-persistence] [--failover-on-shutdown] |
| [--force] [--jdbc] [--linux] [--mapped] [--nio] |
| [--no-amqp-acceptor] [--no-autocreate] [--no-autotune] |
| [--no-fsync] [--no-hornetq-acceptor] [--no-mqtt-acceptor] |
| [--no-stomp-acceptor] [--no-web] [--paging] |
| [--relax-jolokia] [--replicated] [--require-login] |
| [--shared-store] [--silent] [--slave] |
| [--support-advisory] |
| [--suppress-internal-management-objects] |
| [--use-client-auth] [--verbose] [--windows] |
| </span><span class="gp"> [--addresses=<addresses></span><span class="o">]</span> |
| <span class="gp"> [--cluster-password=<clusterPassword></span><span class="o">]</span> |
| <span class="gp"> [--cluster-user=<clusterUser></span><span class="o">]</span> <span class="o">[</span><span class="nt">--data</span><span class="o">=</span><data>] |
| <span class="gp"> [--default-port=<defaultPort></span><span class="o">]</span> <span class="o">[</span><span class="nt">--encoding</span><span class="o">=</span><encoding>] |
| <span class="gp"> [--etc=<etc></span><span class="o">]</span> <span class="o">[</span><span class="nt">--global-max-messages</span><span class="o">=</span><globalMaxMessages>] |
| <span class="gp"> [--global-max-size=<globalMaxSize></span><span class="o">]</span> <span class="o">[</span><span class="nt">--home</span><span class="o">=</span><home>] |
| <span class="gp"> [--host=<host></span><span class="o">]</span> <span class="o">[</span><span class="nt">--http-host</span><span class="o">=</span><httpHost>] |
| <span class="gp"> [--http-port=<httpPort></span><span class="o">]</span> <span class="o">[</span><span class="nt">--java-memory</span><span class="o">=</span><javaMemory>] |
| <span class="gp"> [--jdbc-bindings-table-name=<jdbcBindings></span><span class="o">]</span> |
| <span class="gp"> [--jdbc-connection-url=<jdbcURL></span><span class="o">]</span> |
| <span class="gp"> [--jdbc-driver-class-name=<jdbcClassName></span><span class="o">]</span> |
| <span class="gp"> [--jdbc-large-message-table-name=<jdbcLargeMessages></span><span class="o">]</span> |
| <span class="gp"> [--jdbc-lock-expiration=<jdbcLockExpiration></span><span class="o">]</span> |
| <span class="gp"> [--jdbc-lock-renew-period=<jdbcLockRenewPeriod></span><span class="o">]</span> |
| <span class="gp"> [--jdbc-message-table-name=<jdbcMessages></span><span class="o">]</span> |
| <span class="gp"> [--jdbc-network-timeout=<jdbcNetworkTimeout></span><span class="o">]</span> |
| <span class="gp"> [--jdbc-node-manager-table-name=<jdbcNodeManager></span><span class="o">]</span> |
| <span class="gp"> [--jdbc-page-store-table-name=<jdbcPageStore></span><span class="o">]</span> |
| <span class="gp"> [--journal-device-block-size=<journalDeviceBlockSize></span><span class="o">]</span> |
| <span class="gp"> [--journal-retention=<retentionDays></span><span class="o">]</span> |
| <span class="gp"> [--journal-retention-max-bytes=<retentionMaxBytes></span><span class="o">]</span> |
| <span class="gp"> [--max-hops=<maxHops></span><span class="o">]</span> |
| <span class="gp"> [--message-load-balancing=<messageLoadBalancing></span><span class="o">]</span> |
| <span class="gp"> [--name=<name></span><span class="o">]</span> <span class="o">[</span><span class="nt">--password</span><span class="o">=</span><password>] <span class="o">[</span><span class="nt">--ping</span><span class="o">=</span><ping>] |
| <span class="gp"> [--port-offset=<portOffset></span><span class="o">]</span> <span class="o">[</span><span class="nt">--queues</span><span class="o">=</span><queues>] |
| <span class="gp"> [--role=<role></span><span class="o">]</span> <span class="o">[</span><span class="nt">--security-manager</span><span class="o">=</span><securityManager>] |
| <span class="gp"> [--ssl-key=<sslKey></span><span class="o">]</span> |
| <span class="gp"> [--ssl-key-password=<sslKeyPassword></span><span class="o">]</span> |
| <span class="gp"> [--ssl-trust=<sslTrust></span><span class="o">]</span> |
| <span class="gp"> [--ssl-trust-password=<sslTrustPassword></span><span class="o">]</span> |
| <span class="gp"> [--staticCluster=<staticNode></span><span class="o">]</span> <span class="o">[</span><span class="nt">--user</span><span class="o">=</span><user>] |
| <span class="gp"> [--java-options=<javaOptions></span><span class="o">]</span>... <directory> |
| <span class="go">Create a new broker instance. |
| </span><span class="gp"> <directory></span><span class="w"> </span>The instance directory to hold the broker<span class="s1">'s |
| </span><span class="go"> configuration and data. Path must be writable. |
| </span><span class="gp"> --addresses=<addresses></span><span class="w"> |
| </span><span class="go"> A comma separated list of addresses with the |
| option to specify a routing type, e.g. |
| --addresses myAddress1,myAddress2:anycast. |
| Routing-type default: multicast. |
| --aio Set the journal as asyncio. |
| --allow-anonymous Allow connections from users with no security |
| credentials. Opposite of --require-login. |
| Default: input. |
| --autocreate Allow automatic creation of addresses & queues. |
| Default: true. |
| --autodelete Allow automatic deletion of addresses & queues. |
| Default: false. |
| --backup Be a backup broker. Valid for shared store or |
| replication. |
| --blocking Block producers when address becomes full. |
| Opposite of --paging. Default: false. |
| </span><span class="gp"> --cluster-password=<clusterPassword></span><span class="w"> |
| </span><span class="go"> The password to use for clustering. Default: input. |
| </span><span class="gp"> --cluster-user=<clusterUser></span><span class="w"> |
| </span><span class="go"> The user to use for clustering. Default: input. |
| --clustered Enable clustering. |
| </span><span class="gp"> --data=<data></span><span class="w"> </span>Directory where ActiveMQ data are stored. Paths |
| <span class="go"> can be absolute or relative to artemis.instance |
| directory. Default: data. |
| </span><span class="gp"> --default-port=<defaultPort></span><span class="w"> |
| </span><span class="go"> The port number to use for the main 'artemis' |
| acceptor. Default: 61616. |
| --disable-persistence Disable message persistence to the journal |
| </span><span class="gp"> --encoding=<encoding></span><span class="w"> </span>The encoding that text files should use. Default: |
| <span class="go"> UTF-8. |
| </span><span class="gp"> --etc=<etc></span><span class="w"> </span>Directory where ActiveMQ configuration is located. |
| <span class="go"> Paths can be absolute or relative to artemis. |
| instance directory. Default: etc. |
| --failover-on-shutdown Whether broker shutdown will trigger failover for |
| clients using the core protocol. Valid only for |
| shared store. Default: false. |
| --force Overwrite configuration at destination directory. |
| </span><span class="gp"> --global-max-messages=<globalMaxMessages></span><span class="w"> |
| </span><span class="go"> Maximum number of messages that will be accepted |
| in memory before using address full policy mode. |
| Default: undefined. |
| </span><span class="gp"> --global-max-size=<globalMaxSize></span><span class="w"> |
| </span><span class="go"> Maximum amount of memory which message data may |
| consume. Default: half of the JVM's max memory. |
| </span><span class="gp"> --home=<home></span><span class="w"> </span>Directory where ActiveMQ Artemis is installed. |
| <span class="gp"> --host=<host></span><span class="w"> </span>Broker<span class="s1">'s host name. Default: 0.0.0.0 or input if |
| </span><span class="go"> clustered). |
| </span><span class="gp"> --http-host=<httpHost></span><span class="w"> </span>Embedded web server<span class="s1">'s host name. Default: |
| </span><span class="go"> localhost. |
| </span><span class="gp"> --http-port=<httpPort></span><span class="w"> </span>Embedded web server<span class="s1">'s port. Default: 8161. |
| </span><span class="gp"> --java-memory=<javaMemory></span><span class="w"> |
| </span><span class="go"> Define the -Xmx memory parameter for the broker. |
| Default: 2G. |
| </span><span class="gp"> --java-options=<javaOptions></span><span class="w"> |
| </span><span class="go"> Extra Java options to be passed to the profile. |
| --jdbc Store message data in JDBC instead of local files. |
| </span><span class="gp"> --jdbc-bindings-table-name=<jdbcBindings></span><span class="w"> |
| </span><span class="go"> Name of the jdbc bindings table. |
| </span><span class="gp"> --jdbc-connection-url=<jdbcURL></span><span class="w"> |
| </span><span class="go"> The URL used for the database connection. |
| </span><span class="gp"> --jdbc-driver-class-name=<jdbcClassName></span><span class="w"> |
| </span><span class="go"> JDBC driver classname. |
| </span><span class="gp"> --jdbc-large-message-table-name=<jdbcLargeMessages></span><span class="w"> |
| </span><span class="go"> Name of the large messages table. |
| </span><span class="gp"> --jdbc-lock-expiration=<jdbcLockExpiration></span><span class="w"> |
| </span><span class="go"> Lock expiration (in milliseconds). |
| </span><span class="gp"> --jdbc-lock-renew-period=<jdbcLockRenewPeriod></span><span class="w"> |
| </span><span class="go"> Lock Renew Period (in milliseconds). |
| </span><span class="gp"> --jdbc-message-table-name=<jdbcMessages></span><span class="w"> |
| </span><span class="go"> Name of the jdbc messages table. |
| </span><span class="gp"> --jdbc-network-timeout=<jdbcNetworkTimeout></span><span class="w"> |
| </span><span class="go"> Network timeout (in milliseconds). |
| </span><span class="gp"> --jdbc-node-manager-table-name=<jdbcNodeManager></span><span class="w"> |
| </span><span class="go"> Name of the jdbc node manager table. |
| </span><span class="gp"> --jdbc-page-store-table-name=<jdbcPageStore></span><span class="w"> |
| </span><span class="go"> Name of the page store messages table. |
| </span><span class="gp"> --journal-device-block-size=<journalDeviceBlockSize></span><span class="w"> |
| </span><span class="go"> The block size of the journal's storage device. |
| Default: 4096. |
| </span><span class="gp"> --journal-retention=<retentionDays></span><span class="w"> |
| </span><span class="gp"> Configure journal retention in days. If ></span><span class="w"> </span>0 <span class="k">then</span> |
| <span class="go"> enable journal-retention-directory from broker. |
| xml allowing replay options. |
| </span><span class="gp"> --journal-retention-max-bytes=<retentionMaxBytes></span><span class="w"> |
| </span><span class="go"> Maximum number of bytes to keep in the retention |
| directory. |
| --linux, --cygwin Force Linux or Cygwin script creation. Default: |
| based on your actual system. |
| --mapped Set the journal as mapped. |
| </span><span class="gp"> --max-hops=<maxHops></span><span class="w"> </span>Number of hops on the cluster configuration. |
| <span class="gp"> --message-load-balancing=<messageLoadBalancing></span><span class="w"> |
| </span><span class="go"> Message load balancing policy for cluster. |
| Default: ON_DEMAND. Valid values: ON_DEMAND, |
| STRICT, OFF, OFF_WITH_REDISTRIBUTION. |
| </span><span class="gp"> --name=<name></span><span class="w"> </span>The name of the broker. Default: same as host name. |
| <span class="go"> --nio Set the journal as nio. |
| --no-amqp-acceptor Disable the AMQP specific acceptor. |
| --no-autocreate Disable auto creation for addresses & queues. |
| --no-autotune Disable auto tuning of the journal-buffer-timeout |
| in broker.xml. |
| --no-fsync Disable usage of fdatasync (channel.force(false) |
| from Java NIO) on the journal. |
| --no-hornetq-acceptor Disable the HornetQ specific acceptor. |
| --no-mqtt-acceptor Disable the MQTT specific acceptor. |
| --no-stomp-acceptor Disable the STOMP specific acceptor. |
| --no-web Whether to omit the web-server definition from |
| bootstrap.xml. |
| --paging Page messages to disk when address becomes full. |
| Opposite of --blocking. Default: true. |
| </span><span class="gp"> --password=<password></span><span class="w"> </span>The user<span class="s1">'s password. Default: input. |
| </span><span class="gp"> --ping=<ping></span><span class="w"> </span><span class="s1">A comma separated string to be passed on to the |
| </span><span class="go"> broker config as network-check-list. The broker |
| will shutdown when all these addresses are |
| unreachable. |
| </span><span class="gp"> --port-offset=<portOffset></span><span class="w"> |
| </span><span class="go"> How much to off-set the ports of every acceptor. |
| </span><span class="gp"> --queues=<queues></span><span class="w"> </span>A comma separated list of queues with the option |
| <span class="go"> to specify a routing type, e.g. --queues |
| myQueue1,myQueue2:multicast. Routing-type |
| default: anycast. |
| --relax-jolokia Disable strict checking in jolokia-access.xml. |
| --replicated Enable broker replication. |
| --require-login Require security credentials from users for |
| connection. Opposite of --allow-anonymous. |
| </span><span class="gp"> --role=<role></span><span class="w"> </span>The name <span class="k">for </span>the role created. Default: amq. |
| <span class="gp"> --security-manager=<securityManager></span><span class="w"> |
| </span><span class="go"> Which security manager to use - jaas or basic. |
| Default: jaas. |
| --shared-store Enable broker shared store. |
| --silent Disable all the inputs, and make a best guess for |
| any required input. |
| --slave Deprecated for removal. Use 'backup' instead. |
| </span><span class="gp"> --ssl-key=<sslKey></span><span class="w"> </span>Embedded web server<span class="s1">'s key store path. |
| </span><span class="gp"> --ssl-key-password=<sslKeyPassword></span><span class="w"> |
| </span><span class="go"> The key store's password. |
| </span><span class="gp"> --ssl-trust=<sslTrust></span><span class="w"> </span>The trust store path <span class="k">in case</span> of client |
| <span class="go"> authentication. |
| </span><span class="gp"> --ssl-trust-password=<sslTrustPassword></span><span class="w"> |
| </span><span class="go"> The trust store's password. |
| </span><span class="gp"> --staticCluster, --static-cluster=<staticNode></span><span class="w"> |
| </span><span class="go"> Cluster node connectors list separated by comma, e. |
| g. "tcp://server:61616,tcp://server2:61616,tcp: |
| //server3:61616". |
| --support-advisory Support advisory messages for the OpenWire |
| protocol. |
| --suppress-internal-management-objects |
| Do not register any advisory addresses/queues for |
| the OpenWire protocol with the broker's |
| management service. |
| --use-client-auth Require client certificate authentication when |
| connecting to the embedded web server. |
| </span><span class="gp"> --user=<user></span><span class="w"> </span>The username. Default: input. |
| <span class="go"> --verbose Print additional information. |
| --windows Force Windows script creation. Default: based on |
| your actual system.</span></code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="bash-and-zsh-auto-complete"><a class="anchor" href="#bash-and-zsh-auto-complete"></a><a class="link" href="#bash-and-zsh-auto-complete">2. Bash and Zsh auto complete</a></h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Bash and Zsh provide ways to auto-complete commands. To integrate with that functionality you have the option to generate the auto-complete script, i.e.:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span>./artemis auto-complete</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>This will generate a file named <code>auto-complete-artemis.sh</code> that can be installed using:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span><span class="nb">source</span> ./auto-complete-artemis.sh</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>After the auto-completion is installed you can view auto-completion information by pressing <kbd>TAB</kbd>:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span>./artemis |
| <span class="go">activation browser create kill perf-journal run transfer version |
| address check data mask producer shell upgrade |
| auto-complete consumer help perf queue stop user</span></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>In order to see the various parameters available you must type <code>--</code> then press <kbd>TAB</kbd>:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span>./artemis create <span class="nt">--</span> |
| <span class="go">--addresses --jdbc-bindings-table-name --paging |
| --aio --jdbc-connection-url --password |
| --allow-anonymous --jdbc-driver-class-name --ping |
| --autocreate --jdbc-large-message-table-name --port-offset |
| --autodelete --jdbc-lock-expiration --queues |
| --blocking --jdbc-lock-renew-period --relax-jolokia |
| --cluster-password --jdbc-message-table-name --replicated |
| --cluster-user --jdbc-network-timeout --require-login |
| --clustered --jdbc-node-manager-table-name --role</span></code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="input-required"><a class="anchor" href="#input-required"></a><a class="link" href="#input-required">3. Input required</a></h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>Some functionality may require interactive user input if not explicitly provided through a parameter. |
| For example, in cases like connecting to a broker or creating the broker instance:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span>./artemis queue <span class="nb">stat</span> |
| <span class="go">Connection brokerURL = tcp://localhost:61616 |
| </span><span class="gp">Connection failed::AMQ229031: Unable to validate user from /127.0.0.1:56320. Username: null;</span><span class="w"> </span>SSL certificate subject DN: unavailable |
| <span class="go"> |
| --user: |
| Type the username for a retry |
| myUser |
| |
| --password: is mandatory with this configuration: |
| Type the password for a retry</span></code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="sect1"> |
| <h2 id="artemis-shell"><a class="anchor" href="#artemis-shell"></a><a class="link" href="#artemis-shell">4. Artemis Shell</a></h2> |
| <div class="sectionbody"> |
| <div class="paragraph"> |
| <p>To initialize the shell session, type <code>./artemis shell</code> (or just <code>./artemis</code> if you prefer):</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span>./artemis</code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The ActiveMQ Artemis shell provides an interface that can be used to execute commands directly without leaving the Java Virtual Machine.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="go"> _ _ _ |
| / \ ____| |_ ___ __ __(_) _____ |
| / _ \| _ \ __|/ _ \ \/ | |/ __/ |
| / ___ \ | \/ |_/ __/ |\/| | |\___ \ |
| /_/ \_\| \__\____|_| |_|_|/___ / |
| Apache ActiveMQ Artemis |
| |
| |
| </span><span class="gp">For a list of commands, type help or press <TAB></span>: |
| <span class="gp">Type exit or press <CTRL-D></span><span class="w"> </span>to leave the session: |
| <span class="gp">Apache ActiveMQ Artemis ></span></code></pre> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="connecting-interactively"><a class="anchor" href="#connecting-interactively"></a><a class="link" href="#connecting-interactively">4.1. Connecting Interactively</a></h3> |
| <div class="paragraph"> |
| <p>It is possible to authenticate your CLI client once to the server and reuse the connection information for additional commands:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">Apache ActiveMQ Artemis ></span><span class="w"> </span>connect <span class="nt">--user</span><span class="o">=</span>myUser <span class="nt">--password</span><span class="o">=</span>myPass <span class="nt">--url</span> tcp://localhost:61616 |
| <span class="go">Connection brokerURL = tcp://localhost:61616 |
| Connection Successful!</span></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>Now any command requiring authentication will reuse these parameters.</p> |
| </div> |
| <div class="paragraph"> |
| <p>For example the sub-command <code>queue stat</code> will reuse previous information to perform its connection to the broker.</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">Apache ActiveMQ Artemis ></span><span class="w"> </span>queue <span class="nb">stat</span> |
| <span class="go">Connection brokerURL = tcp://localhost:61616 |
| |NAME |ADDRESS |CONSUMER_COUNT|MESSAGE_COUNT|MESSAGES_ADDED|DELIVERING_COUNT|MESSAGES_ACKED|SCHEDULED_COUNT|ROUTING_TYPE| |
| |DLQ |DLQ |0 |0 |0 |0 |0 |0 |ANYCAST | |
| |ExpiryQueue |ExpiryQueue |0 |0 |0 |0 |0 |0 |ANYCAST | |
| |Order |Order |0 |4347 |4347 |0 |0 |0 |ANYCAST | |
| |activemq.management.0b...|activemq.management.0b...|1 |0 |0 |0 |0 |0 |MULTICAST |</span></code></pre> |
| </div> |
| </div> |
| </div> |
| <div class="sect2"> |
| <h3 id="connecting-statically"><a class="anchor" href="#connecting-statically"></a><a class="link" href="#connecting-statically">4.2. Connecting Statically</a></h3> |
| <div class="paragraph"> |
| <p>It is possible to start the shell with an initial connection configured statically, e.g.:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span>./artemis shell <span class="nt">--user</span> <username> <span class="nt">--password</span> <password> <span class="nt">--url</span> tcp://<<span class="nb">hostname</span><span class="o">></span>:<port></code></pre> |
| </div> |
| </div> |
| <div class="paragraph"> |
| <p>The CLI should not ask for a the broker URL or user/password for any further commands, e.g.:</p> |
| </div> |
| <div class="listingblock"> |
| <div class="content"> |
| <pre class="rouge highlight nowrap"><code data-lang="console"><span class="gp">$</span><span class="w"> </span>./artemis shell <span class="nt">--user</span> myUser <span class="nt">--password</span> myPass |
| <span class="c">... |
| </span><span class="go"> |
| |
| </span><span class="gp">Apache ActiveMQ Artemis ></span><span class="w"> </span>queue <span class="nb">stat</span> |
| <span class="go">Connection brokerURL = tcp://localhost:61616 |
| |NAME |ADDRESS |CONSUMER_COUNT|MESSAGE_COUNT|MESSAGES_ADDED|DELIVERING_COUNT|MESSAGES_ACKED|SCHEDULED_COUNT|ROUTING_TYPE| |
| |DLQ |DLQ |0 |0 |0 |0 |0 |0 |ANYCAST | |
| |ExpiryQueue |ExpiryQueue |0 |0 |0 |0 |0 |0 |ANYCAST | |
| |TEST |TEST |0 |8743 |8743 |0 |0 |0 |ANYCAST | |
| |activemq.management.2a...|activemq.management.2a...|1 |0 |0 |0 |0 |0 |MULTICAST |</span></code></pre> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| </body> |
| </html> |