Chapter 8. Sending Commands to the Broker
Abstract
Overview
- the JBoss A-MQ administration client that can be used to send any of the console commands to a broker running in daemon mode
- a broker running in console mode can connect to a remote broker and be used to manage the remote broker
- Red Hat JBoss A-MQ includes a vanilla Apache Karaf shell that can connect to a remote broker and be used to manage the remote broker
Running the administration client
InstallDir/bin. Example 8.1, “Client Command” shows the syntax for the command.
Example 8.1. Client Command
client [
--help
] [
-a port
] [
-h host
] [
-u user
] [
-p password
] [
-v
] [
-r attempts
] [
-d delay
] [
commands
]
Table 8.1. Administration Client Arguments
| Argument | Description |
|---|---|
--help | Displays the help message. |
-a | Specifies the remote host's port. |
-h | Specify the remote host's name. |
-u | Specifies user name used to log into the broker. |
-p | Specifies the password used to log into the broker. |
-v | Use verbose output. |
-r | Specifies the maximum number of attempts to establish a connection. |
-d | Specifies, in seconds, the delay between retries. The default is 2 seconds. |
| commands | Specifies one or more commands to run. If no commands are specified, the client enters an interactive mode. |
Using the broker console
- console help—list all of the commands along with a brief summary of the commands function
- command help—a detailed description of a command and its arguments
Example 8.2. Console Help
JBossA-MQ:karaf@root>helpCOMMANDS activemq:browse activemq:bstat activemq:list activemq:purge activemq:query admin:change-opts Changes the Java options of an existing container instance. admin:change-rmi-registry-port Changes the RMI registry port (used by management layer) of an existing container instance....JBossA-MQ:karaf@root>
--help option. As shown in Example 8.3, “Help for a Command”, entering admin:start --help displays the help for that command.
Example 8.3. Help for a Command
JBossA-MQ:karaf@root>admin:start --helpDESCRIPTION admin:start Starts an existing container instance. SYNTAX admin:start [options] name ARGUMENTS name The name of the container instance OPTIONS --help Display this help message -o, --java-opts Java options when launching the instanceJBossA-MQ:karaf@root>
Connecting a console to a remote broker
-p flag. You can also specify a command to be executed by the remote console connection. If you do not specify a command, you are presented with a prompt that will pass commands to the remote broker's console.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.