Invoking MBeans Programmatically
JConsole is just one way to use the JMX services that are exposed by the JVM. You can also build your own clients to consume JMX services. This is a handy way to write tools you can use to manage your applications.
To create a JMX client, you’ll need some libraries that can speak to the JMX interfaces. Fortunately, the jmx4r gem provides a Ruby wrapper for this Java-based protocol.
Install the jmx4r gem with the following command:
| | $ gem install jmx4r |
Before using this gem, you’ll need to make sure a JRuby server is running.
| | $ ruby --manage -S bin/puma |
Now you can connect to the JMX services in the JRuby process from the shell. Begin by starting an IRB session and requiring ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access