Reputation: 2572
In my spring, hibernate application RMQ is used. I have a url in this application to check the status the DB connection and the status of the threads. I also want to include the status check of RMQ
connection from the application. Please guide me.
Upvotes: 1
Views: 6531
Reputation: 3128
It is hard to give a specific answer as this depends on how you manage connections to the RabbitMQ broker in your application...
However in essence all you need to do is look at the IsOpen property on the connection
You probably have this code somewhere in your application:
ConnectionFactory factory = new ConnectionFactory();
factory.set...
Connection connection = factory.newConnection();
all you need to do to check the current state is:
bool connected = connection.IsOpen();
Upvotes: 4