Red Hat AMQ 6
As of February 2025, Red Hat is no longer supporting Red Hat AMQ 6. If you are using AMQ 6, please upgrade: Migrating to AMQ 7.Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 8. Sending Commands to the Broker
Abstract
Overview
- the AMQ 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 AMQ 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
				]
| 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> help
COMMANDS 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>
JBossA-MQ:karaf@root> help
COMMANDS 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 --help DESCRIPTION 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 instance JBossA-MQ:karaf@root>
JBossA-MQ:karaf@root> admin:start --help
DESCRIPTION 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 instance 
JBossA-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.