public class RabbitMqCtl extends Object
RabbitMqCommand to make it easier to execute ""rabbitmqctl"" commands.
The methods contained in this class aren't exhaustive. Please refer to the manual for a complete list.
| Constructor and Description |
|---|
RabbitMqCtl(EmbeddedRabbitMqConfig config) |
| Modifier and Type | Method and Description |
|---|---|
Future<org.zeroturnaround.exec.ProcessResult> |
execute(String... arguments)
This method exposes a way to invoke "rabbitmqctl" with any arguments.
|
Future<org.zeroturnaround.exec.ProcessResult> |
forceReset()
Forcefully return a RabbitMQ node to its virgin state.
|
Future<org.zeroturnaround.exec.ProcessResult> |
reset()
Return a RabbitMQ node to its virgin state.
|
Future<org.zeroturnaround.exec.ProcessResult> |
startApp()
Starts the RabbitMQ application.
|
Future<org.zeroturnaround.exec.ProcessResult> |
stop()
Stops the Erlang node on which RabbitMQ is running.
|
Future<org.zeroturnaround.exec.ProcessResult> |
stopApp()
Stops the RabbitMQ application, leaving the Erlang node running.
|
public static final String COMMAND
public RabbitMqCtl(EmbeddedRabbitMqConfig config)
public Future<org.zeroturnaround.exec.ProcessResult> execute(String... arguments) throws RabbitMqCommandException
For example:
RabbitMqCtl command = new RabbitMqCtl(config);
command.execute("list_users");
RabbitMqCommandExceptionpublic Future<org.zeroturnaround.exec.ProcessResult> stop() throws RabbitMqCommandException
RabbitMqCommandExceptionpublic Future<org.zeroturnaround.exec.ProcessResult> stopApp() throws RabbitMqCommandException
This command is typically run prior to performing other management actions that require the
RabbitMQ application to be stopped, e.g. reset().
RabbitMqCommandExceptionpublic Future<org.zeroturnaround.exec.ProcessResult> startApp() throws RabbitMqCommandException
This command is typically run after performing other management actions that required the
RabbitMQ application to be stopped, e.g. reset().
RabbitMqCommandExceptionpublic Future<org.zeroturnaround.exec.ProcessResult> reset() throws RabbitMqCommandException
Removes the node from any cluster it belongs to, removes all data from the management database, such as configured users and vhosts, and deletes all persistent messages.
For reset and force_reset to succeed the RabbitMQ application must have been stopped, e.g. with stopApp()
RabbitMqCommandExceptionpublic Future<org.zeroturnaround.exec.ProcessResult> forceReset() throws RabbitMqCommandException
The force_reset command differs from reset in that it resets the node unconditionally, regardless of the current management database state and cluster configuration. It should only be used as a last resort if the database or cluster configuration has been corrupted.
For reset and force_reset to succeed the RabbitMQ application must have been stopped, e.g. with stopApp()
RabbitMqCommandExceptionCopyright © 2016–2017. All rights reserved.