3장. Using the command line interface
The command line interface (CLI) allows interaction with the message broker by use of an interactive shell. You can manage broker actions, configure messages, add users and roles to files and enter other useful commands by using the CLI.
You can use the CLI to interact with the broker in a Bash or Zsh shell, or a custom artemis shell. The same commands are available in each shell. By default, the artemis shell has built-in auto-completion of commands and command parameters. You can add auto-completion of the CLI commands and command parameters to a Bash or Zsh shell also.
3.1. Using the CLI in an artemis shell 링크 복사링크가 클립보드에 복사되었습니다!
The artemis shell interface provides auto-completion of commands and parameters that can be used with the artemis command. The shell also reuses the connection information provided, such as the broker URI and login credentials, for subsequent commands that you run in the same shell session.
Procedure
Switch to the user account you created during installation, for example:
$ su - amq-brokerUse the
artemiscommand to start the shell, for example:$ /var/opt/amq-broker/mybroker/bin/artemisIf you want to supply the broker connection details when you start an
artemisshell, use theartemis shellcommand. For example:$ /var/opt/amq-broker/mybroker/bin/artemis shell --user myuser --password mypassword --url tcp://localhost:61616The credentials and URI provided are reused for any subsequent command run in the shell that requires authentication with a broker.
Press Tab to display auto-completion information anywhere in the shell. For example:
-
To display a list of commands available in the
artemisshell, press Tab at the shell prompt. -
To display sub-commands for a command, press Tab after the command. For example, type
checkand press Tab to display the sub-commands for thecheckcommand. The auto-completion information shows that thecheckcommand supports three sub-commands:cluster,nodeandqueue. -
To display auto-completion information for a sub-command, press Tab after the sub-command. For example, type
check nodeand press Tab. If no further auto-completion information is displayed, type--, for example,check node --, and press Tab to display the parameters available for the command.
-
To display a list of commands available in the