public class RabbitMqServer extends Object
", used for starting the RabbitMQ broker.| Constructor and Description |
|---|
RabbitMqServer(EmbeddedRabbitMqConfig config)
Creates a new RabbitMqServer with NOOP settings for output capturing and event listening.
|
| Modifier and Type | Method and Description |
|---|---|
RabbitMqServer |
listeningToEventsWith(org.zeroturnaround.exec.listener.ProcessListener listener)
Use this method to register a listener to be notified of process events, like start, stop, etc.
|
Future<org.zeroturnaround.exec.ProcessResult> |
start()
Starts the RabbitMQ Server and keeps the process running until it's stopped.
|
Future<org.zeroturnaround.exec.ProcessResult> |
startDetached()
Start the RabbitMq Server in a detached state.
|
RabbitMqServer |
writeOutputTo(OutputStream outputStream)
Use this method if you wish the output of the process is streamed somewhere as it happens.
|
public RabbitMqServer(EmbeddedRabbitMqConfig config)
public RabbitMqServer writeOutputTo(OutputStream outputStream)
RabbitMqCommand.writeOutputTo(OutputStream)public RabbitMqServer listeningToEventsWith(org.zeroturnaround.exec.listener.ProcessListener listener)
public Future<org.zeroturnaround.exec.ProcessResult> start() throws RabbitMqCommandException
Running rabbitmq-server in the foreground displays a banner message, and reports on progress in the startup
sequence, concluding with the message "completed with [N] plugins.", indicating that the
RabbitMQ broker has been started successfully.
To read the output, either:
ProcessResult output getter methods, or writeOutputTo(OutputStream) to receive it as it happens. To be notified of process events, such as the process starting or finishing, provide a
RabbitMqCommandExceptionpublic Future<org.zeroturnaround.exec.ProcessResult> startDetached() throws RabbitMqCommandException
This means the process will exit immediately and no PID file will be written to file.
RabbitMqCommandExceptionCopyright © 2016–2021. All rights reserved.