Command line interface

This topic describes the zero broker administrative tasks, which can be used to manage messaging brokers from the command line. These commands are available when the application includes the zero.messaging.broker module.

Listing messaging brokers

The list command displays the name and massage store directory for all messaging brokers that have been created by the current user on the local machine. The generated list can include messaging brokers that have been deleted from the filing system but which are still recoded in the Java™ preferences store.

The syntax of the list command is as follows:

zero broker list

The following example contains some sample output from the list command:

C:\apps\broker1>zero broker list
Broker name                         Message store directory
sample.broker1                      C:\apps\broker1\messageStore
test.broker                         C:\apps\test\messageStore
CWPZT0600I: Command zero broker list was successful

Destroying a messaging broker

The destroy command permanently deletes a messaging broker and its message store from the local machine. You can use this command to remove any messaging broker discovered by the list, provided the messaging broker is not running. For example, the destroy command can be used to reset the state of a messaging broker before executing a test scenario or to remove the definition of a decommissioned messaging broker.

Destroying an existing messaging broker also destroys all the messages in its message store so this command must be used with care. Do not destroy a messaging broker that is still in production.

To destroy the messaging broker created by an application, enter the following command from within the root directory of the application:

zero broker destroy brokerName

The supplied broker name must match the name of the broker defined in the application's zero.config file. If the supplied name does not match then the destroy operation is not performed. The messaging broker application must be stopped before issuing this command.

If the root directory of the original messaging broker application is no longer available, you can destroy a broker from any application that includes the zero.messaging.broker dependency using the following command:

zero broker destroy brokerName messageStoreDirectory

Both the supplied broker name and the message store directory name must match the values reported by zero broker list for the messaging broker to be destroyed. If the supplied names do not match then the destroy operation is not performed. The messaging broker application must be stopped before issuing this command.

Version 1.1.26825