[rabbitmq-discuss] How can we check that rabbitMQ server is running using java code?

Jerry Kuch jerryk at vmware.com
Fri Feb 18 23:19:41 GMT 2011


> Hi,
> How can i program my java code that will give information that RabbitMQ
> server is running or not?
>

Hi, Cheepu...

>From where are you trying to find out whether the Rabbit broker is
running or not?  If you're trying to determine this from a remote Java
client, just seeing that the client can't connect to Rabbit at its
expected host and port by the exception that will be thrown if the
broker can't be reached ought to be sensible.  After all, if there's
nothing responding, there's not much more your remote application can
do.

If your Java code is a process on the same box, you may have a few
more options, including looking for the Erlang 'beam' process that
Rabbit is running in, exec-ing 'rabbitmqctl status', etc.

Best regards,
Jerry


More information about the rabbitmq-discuss mailing list