Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Configuring JMX Adapter #471

Open
dboreham opened this issue Aug 6, 2021 · 5 comments
Open

Document Configuring JMX Adapter #471

dboreham opened this issue Aug 6, 2021 · 5 comments

Comments

@dboreham
Copy link

dboreham commented Aug 6, 2021

Apologies if this is document somewhere already. I'm interested in using the code in this PR to connect jconsole to my jolokia-enabled production JMVs.
I'm lacking in deep JMX knowledge, but I get the impression that the idea here is to load a transport provider plugin class, or whatever is the correct terminology here, into a JMX client tool such as jconsole, such that it speaks to its target JVM using the jolokia protocol rather than stock JMX protocol (RMI over TCP?). This sounds great, but I have no idea how to a) get that code in place so the JMX tool can load it nor b) how to configure said tool to use the new transport. The YouTube videos hint that there is a URI scheme to target a specific transport (jolokia), then subsequent URI path is the jolokia URL. I'd be happy to write this doc if someone can provide me with some hints as to how to do the config. Thanks.

@rhuss
Copy link
Member

rhuss commented Aug 6, 2021

good point, and a comprehensive documentation is definitely on the task list. In the meantime, could you give some hints about the usage of the connectors, @skarsaune ? We could use that then directly as input for the proper documentation.

@skarsaune
Copy link
Contributor

Absolutely. Sorry, have been quite busy. It is in my list. Will reply with example soon

@skarsaune
Copy link
Contributor

skarsaune commented Aug 8, 2021

So for instance JConsole as the simplest tool, you could simply add jolokia-jmx-adapter-1.7.0-standalone.jar to the classpath as shown in this script (modify to the file location)
https://github.com/rhuss/jolokia/blob/master/client/jmx-adapter/src/test/scripts/runJConsole.sh

Then you may connect by using the JMX service url : service:jmx:jolokia://hostname:portnumber/path/to/jolokia/

For VisualVM and JMC I am working on plugins that would allow you to include it without having to do any manual scripting.

For custom Java code you may see the Javadoc here: https://github.com/rhuss/jolokia/blob/12e67893483f7d99f9fbe12bd4b6972e28e5d5a1/client/jmx-adapter/src/main/java/org/jolokia/client/jmxadapter/JolokiaJmxConnectionProvider.java#L21

@skarsaune
Copy link
Contributor

@dboreham : Feel free to try out the plugins for Java Mission Control. Let me know how it works for you.
Installation instructions in the Readme : https://github.com/skarsaune/jmc-cloud-extensions

@skarsaune
Copy link
Contributor

@dboreham : Here is a visualvm plugin that you can download: https://skarsaune.github.io/jolokia-jmc-update-site/visualvm/org-jolokia-jmx-plugin.nbm
Be aware that flight recorder / diagnostic commands need a fix on either jolokia / visualvm side: oracle/visualvm#352
But other operations run fine.
Let me know how you fare ! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants