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.

There are two ways the CLI can be used:

  • Traditional CLI commands, e.g.: ./artemis [COMMAND] [PARAMETERS]

  • A custom shell that is accesssed using the ./artemis or ./artemis shell commands.

All commands available through the traditional CLI commands are also available through the shell interface.

One benefit of the traditional CLI commands is that they can be used in your own bash scripts for automation, etc.

One benefit of the shell is that it will reuse 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 ./artemis for every command.

1. Getting Help

You can get a complete list of available commands by typing:

$ ./artemis help
Usage: artemis [COMMAND]
ActiveMQ Artemis Command Line
  help           use 'help <command>' for more information
  auto-complete  Generates the auto complete script file to be used in bash or
  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.

It is also possible to use help at a specific command or sub-command for more information. For example, to get a list of sub-commands for data you type ./artemis help data:

$ ./artemis help data
Usage: artemis data [COMMAND]
use 'help data' for sub commands list
  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.

Or you can get help for a particular command. For example, ./artemis help create:

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]
                      [--use-client-auth] [--verbose] [--windows]
                      [--cluster-user=<clusterUser>] [--data=<data>]
                      [--default-port=<defaultPort>] [--encoding=<encoding>]
                      [--etc=<etc>] [--global-max-messages=<globalMaxMessages>]
                      [--global-max-size=<globalMaxSize>] [--home=<home>]
                      [--host=<host>] [--http-host=<httpHost>]
                      [--http-port=<httpPort>] [--java-memory=<javaMemory>]
                      [--name=<name>] [--password=<password>] [--ping=<ping>]
                      [--port-offset=<portOffset>] [--queues=<queues>]
                      [--role=<role>] [--security-manager=<securityManager>]
                      [--staticCluster=<staticNode>] [--user=<user>]
                      [--java-options=<javaOptions>]... <directory>
Create a new broker instance.
      <directory>            The instance directory to hold the broker's
                               configuration and data. Path must be writable.
                             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
      --blocking             Block producers when address becomes full.
                               Opposite of --paging. Default: false.
                             The password to use for clustering. Default: input.
                             The user to use for clustering. Default: input.
      --clustered            Enable clustering.
      --data=<data>          Directory where ActiveMQ data are stored. Paths
                               can be absolute or relative to artemis.instance
                               directory. Default: data.
                             The port number to use for the main 'artemis'
                               acceptor. Default: 61616.
      --disable-persistence  Disable message persistence to the journal
      --encoding=<encoding>  The encoding that text files should use. Default:
      --etc=<etc>            Directory where ActiveMQ configuration is located.
                               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.
                             Maximum number of messages that will be accepted
                               in memory before using address full policy mode.
                               Default: undefined.
                             Maximum amount of memory which message data may
                               consume. Default: half of the JVM's max memory.
      --home=<home>          Directory where ActiveMQ Artemis is installed.
      --host=<host>          Broker's host name. Default: or input if
      --http-host=<httpHost> Embedded web server's host name. Default:
      --http-port=<httpPort> Embedded web server's port. Default: 8161.
                             Define the -Xmx memory parameter for the broker.
                               Default: 2G.
                             Extra Java options to be passed to the profile.
      --jdbc                 Store message data in JDBC instead of local files.
                             Name of the jdbc bindings table.
                             The URL used for the database connection.
                             JDBC driver classname.
                             Name of the large messages table.
                             Lock expiration (in milliseconds).
                             Lock Renew Period (in milliseconds).
                             Name of the jdbc messages table.
                             Network timeout (in milliseconds).
                             Name of the jdbc node manager table.
                             Name of the page store messages table.
                             The block size of the journal's storage device.
                               Default: 4096.
                             Configure journal retention in days. If > 0 then
                               enable journal-retention-directory from broker.
                               xml allowing replay options.
                             Maximum number of bytes to keep in the retention
      --linux, --cygwin      Force Linux or Cygwin script creation. Default:
                               based on your actual system.
      --mapped               Set the journal as mapped.
      --max-hops=<maxHops>   Number of hops on the cluster configuration.
                             Message load balancing policy for cluster.
                               Default: ON_DEMAND. Valid values: ON_DEMAND,
                               STRICT, OFF, OFF_WITH_REDISTRIBUTION.
      --name=<name>          The name of the broker. Default: same as host name.
      --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
      --paging               Page messages to disk when address becomes full.
                               Opposite of --blocking. Default: true.
      --password=<password>  The user's password. Default: input.
      --ping=<ping>          A comma separated string to be passed on to the
                               broker config as network-check-list. The broker
                               will shutdown when all these addresses are
                             How much to off-set the ports of every acceptor.
      --queues=<queues>      A comma separated list of queues with the option
                               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.
      --role=<role>          The name for the role created. Default: amq.
                             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.
      --ssl-key=<sslKey>     Embedded web server's key store path.
                             The key store's password.
      --ssl-trust=<sslTrust> The trust store path in case of client
                             The trust store's password.
      --staticCluster, --static-cluster=<staticNode>
                             Cluster node connectors list separated by comma, e.
                               g. "tcp://server:61616,tcp://server2:61616,tcp:
      --support-advisory     Support advisory messages for the OpenWire
                             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.
      --user=<user>          The username. Default: input.
      --verbose              Print additional information.
      --windows              Force Windows script creation. Default: based on
                               your actual system.

2. Bash and Zsh auto complete

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.:

$ ./artemis auto-complete

This will generate a file named that can be installed using:

$ source ./

After the auto-completion is installed you can view auto-completion information by pressing TAB:

$ ./artemis
activation     browser        create         kill           perf-journal   run            transfer       version
address        check          data           mask           producer       shell          upgrade
auto-complete  consumer       help           perf           queue          stop           user

In order to see the various parameters available you must type -- then press TAB:

$ ./artemis create --
--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

3. Input required

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:

$ ./artemis queue stat
Connection brokerURL = tcp://localhost:61616
Connection failed::AMQ229031: Unable to validate user from / Username: null; SSL certificate subject DN: unavailable

Type the username for a retry

--password: is mandatory with this configuration:
Type the password for a retry

4. Artemis Shell

To initialize the shell session, type ./artemis shell (or just ./artemis if you prefer):

$ ./artemis

The ActiveMQ Artemis shell provides an interface that can be used to execute commands directly without leaving the Java Virtual Machine.

     _        _               _
    / \  ____| |_  ___ __  __(_) _____
   / _ \|  _ \ __|/ _ \  \/  | |/  __/
  / ___ \ | \/ |_/  __/ |\/| | |\___ \
 /_/   \_\|   \__\____|_|  |_|_|/___ /
 Apache ActiveMQ Artemis

For a list of commands, type help or press <TAB>:
Type exit or press <CTRL-D> to leave the session:
Apache ActiveMQ Artemis >

4.1. Connecting Interactively

It is possible to authenticate your CLI client once to the server and reuse the connection information for additional commands:

Apache ActiveMQ Artemis > connect --user=myUser --password=myPass --url tcp://localhost:61616
Connection brokerURL = tcp://localhost:61616
Connection Successful!

Now any command requiring authentication will reuse these parameters.

For example the sub-command queue stat will reuse previous information to perform its connection to the broker.

Apache ActiveMQ Artemis > queue stat
Connection brokerURL = tcp://localhost:61616
|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     |
|||1             |0            |0             |0               |0             |0              |MULTICAST   |

4.2. Connecting Statically

It is possible to start the shell with an initial connection configured statically, e.g.:

$ ./artemis shell --user <username> --password <password> --url tcp://<hostname>:<port>

The CLI should not ask for a the broker URL or user/password for any further commands, e.g.:

$ ./artemis shell --user myUser --password myPass

Apache ActiveMQ Artemis > queue stat
Connection brokerURL = tcp://localhost:61616
|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     |
|||1             |0            |0             |0               |0             |0              |MULTICAST   |