As mentioned in the previous recipe, we can monitor the RabbitMQ behavior by accessing its log files in quite a conventional way.
It is also possible to access the same kind of information using RabbitMQ itself, by informing a generic AMQP client of the broker activity.
To run this recipe, we need RabbitMQ up and running and the Java client library.
To consume log messages, you can execute the Java main function in
Consumer.java. You can find this in the book source archive in the directory
Chapter12/Recipe02/Java/src/rmqexample. In the following, we highlight the main steps:
String tmpQueue = channel.queueDeclare().getQueue(); ...